use quote::quote; use syn::{parse_macro_input, DeriveInput}; #[proc_macro_derive(Component)] pub fn my_derive(stream: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = parse_macro_input!(stream as DeriveInput); let st_name = input.ident; let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); quote! { impl #impl_generics Component for #st_name #ty_generics #where_clause {} } .into() }