hir_expand::proc_macro

Trait ProcMacroExpander

Source
pub trait ProcMacroExpander:
    Debug
    + Send
    + Sync
    + RefUnwindSafe {
    // Required method
    fn expand(
        &self,
        subtree: &TopSubtree,
        attrs: Option<&TopSubtree>,
        env: &Env,
        def_site: Span,
        call_site: Span,
        mixed_site: Span,
        current_dir: Option<String>,
    ) -> Result<TopSubtree, ProcMacroExpansionError>;
}
Expand description

A proc-macro expander implementation.

Required Methods§

Source

fn expand( &self, subtree: &TopSubtree, attrs: Option<&TopSubtree>, env: &Env, def_site: Span, call_site: Span, mixed_site: Span, current_dir: Option<String>, ) -> Result<TopSubtree, ProcMacroExpansionError>

Run the expander with the given input subtree, optional attribute input subtree (for ProcMacroKind::Attr), environment variables, and span information.

Implementors§