Trait hir_expand::proc_macro::ProcMacroExpander

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

A proc-macro expander implementation.

Required Methods§

source

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

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

Implementors§