[−][src]Trait macro_compose::Expand
Expand is used for expanding macros
Example
use macro_compose::{Collector, Expand}; use syn::{parse_quote, DeriveInput, Error, ItemImpl}; struct ImplFooExpand; impl Expand<DeriveInput> for ImplFooExpand { type Output = ItemImpl; fn expand(&self, input: &DeriveInput, c: &mut Collector) -> Option<Self::Output> { let ident = &input.ident; Some(parse_quote!( impl Foo for #ident { fn bar(&self) {} } )) } }