pub trait ProcMacroExpander:
Debug
+ Send
+ Sync
+ RefUnwindSafe
+ AsAny {
// Required methods
fn expand(
&self,
subtree: &TopSubtree,
attrs: Option<&TopSubtree>,
env: &Env,
def_site: Span,
call_site: Span,
mixed_site: Span,
current_dir: String,
) -> Result<TopSubtree, ProcMacroExpansionError>;
fn eq_dyn(&self, other: &dyn ProcMacroExpander) -> bool;
}
Expand description
A proc-macro expander implementation.
Required Methods§
Sourcefn expand(
&self,
subtree: &TopSubtree,
attrs: Option<&TopSubtree>,
env: &Env,
def_site: Span,
call_site: Span,
mixed_site: Span,
current_dir: String,
) -> Result<TopSubtree, ProcMacroExpansionError>
fn expand( &self, subtree: &TopSubtree, attrs: Option<&TopSubtree>, env: &Env, def_site: Span, call_site: Span, mixed_site: Span, current_dir: String, ) -> Result<TopSubtree, ProcMacroExpansionError>
Run the expander with the given input subtree, optional attribute input subtree (for
ProcMacroKind::Attr
), environment variables, and span information.