macro_rules! derive {
($item:expr, $impl:expr $(,)?) => { ... };
}Expand description
Handles proc_macro_derive
implementation.
Takes any TokenStream for item and returns any TokenStream. body
takes a DeriveMacroHandler with one TokenStream or type implementing
Parse parameter and returns a TokenStream or type implementing
ToTokens. And an optional &mut Emitter and &mut TokenStream for storing a dummy output.
use manyhow::{derive, Emitter, Result};
use proc_macro2::TokenStream;
derive!(item, |item: syn::DeriveInput,
dummy: &mut TokenStream,
emitter: &mut Emitter|
-> Result {
// ..
});