feat: add WebSocketEvent derive, bump to 0.2.1

This commit is contained in:
kozabrada123 2024-04-19 16:24:12 +02:00
parent 171b46c4d7
commit 07a54a4341
3 changed files with 14 additions and 2 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,6 +1,6 @@
[package]
name = "chorus-macros"
version = "0.2.0"
version = "0.2.1"
edition = "2021"
license = "AGPL-3.0"
description = "Macros for the chorus crate."

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