[−][src]Macro proc_macro_hack::proc_macro_item_impl
macro_rules! proc_macro_item_impl { ($( $( #[$attr:meta] )* pub fn $func:ident($input:ident: &str) -> String $body:block )+) => { ... }; }
Implement a hacky procedural macro that expands to items.
ⓘThis example is not tested
proc_macro_item_impl! { /// A function that always returns 2. pub fn two_fn_impl(input: &str) -> String { format!("fn {}() -> u8 {{ 2 }}", input) } }