ezinput_macros/
lib.rs

1extern crate proc_macro;
2
3use proc_macro::TokenStream;
4use syn::{parse_macro_input, DeriveInput};
5
6#[proc_macro_derive(BindingTypeView)]
7pub fn derive_binding_type_view(_item: TokenStream) -> TokenStream {
8    let struct_name = &parse_macro_input!(_item as DeriveInput).ident;
9    let code = quote::quote! {
10        impl BindingTypeView for #struct_name {}
11    };
12    TokenStream::from(code)
13}
14