Trait manyhow::FunctionMacroHandler
source · pub trait FunctionMacroHandler<Function> {
type Input;
type Dummy;
type Output;
// Required method
fn call(
self,
item: Self::Input,
dummy: &mut Self::Dummy,
emitter: &mut Emitter
) -> Self::Output;
}
Expand description
Input of a function proc-macro
Note: for TokenStream
either proc_macro::TokenStream
or
proc_macro2::TokenStream
can be used.
Trait is implemented for any function
, taking in
one TokenStream
.
Additionally, they can take optionally in any order a &mut Emitter
which allows emitting errors without returning early. And
a &mut TokenStream
to return a dummy TokenStream
on failure.
When used with
function()
it must return a type implementing MacroOutput
, with
function!
it can accept types implementing Parse
and return types
implementing ToTokens
.