is_tree_macro/
lib.rs

1use proc_macro::TokenStream;
2
3mod traits;
4mod type_;
5
6use traits::Derive;
7use type_::Type;
8
9#[proc_macro_derive(IsTree, attributes(tree))]
10pub fn is_tree(input: TokenStream) -> TokenStream {
11    let ast = syn::parse_macro_input!(input as syn::DeriveInput);
12    Type::from(ast).derive().into()
13}