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:
kozabrada123 2024-04-19 17:13:36 +02:00 committed by GitHub
parent 171b46c4d7
commit a710edc2a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 3 deletions

View File

@ -15,7 +15,7 @@ dependencies = [
[[package]]
name = "chorus-macros"
version = "0.1.0"
version = "0.2.1"
dependencies = [
"async-trait",
"quote",

View File

@ -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]

View File

@ -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();