add WebSocketEvent macro derive, bump chorus-macros to 0.3.0 (#490)
* feat: add WebSocketEvent derive, bump to 0.2.1 * change license, version of macros
This commit is contained in:
parent
171b46c4d7
commit
a710edc2a1
|
@ -15,7 +15,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "chorus-macros"
|
||||
version = "0.1.0"
|
||||
version = "0.2.1"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"quote",
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
[package]
|
||||
name = "chorus-macros"
|
||||
version = "0.2.0"
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0"
|
||||
license = "MPL-2.0"
|
||||
description = "Macros for the chorus crate."
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -6,6 +6,18 @@ use proc_macro::TokenStream;
|
|||
use quote::quote;
|
||||
use syn::{parse_macro_input, Data, DeriveInput, Field, Fields, FieldsNamed};
|
||||
|
||||
#[proc_macro_derive(WebSocketEvent)]
|
||||
pub fn websocket_event_macro_derive(input: TokenStream) -> TokenStream {
|
||||
let ast: syn::DeriveInput = syn::parse(input).unwrap();
|
||||
|
||||
let name = &ast.ident;
|
||||
|
||||
quote! {
|
||||
impl WebSocketEvent for #name {}
|
||||
}
|
||||
.into()
|
||||
}
|
||||
|
||||
#[proc_macro_derive(Updateable)]
|
||||
pub fn updateable_macro_derive(input: TokenStream) -> TokenStream {
|
||||
let ast: syn::DeriveInput = syn::parse(input).unwrap();
|
||||
|
|
Loading…
Reference in New Issue