Trait ProcMacroExpander

Source
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§

Source

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.

Source

fn eq_dyn(&self, other: &dyn ProcMacroExpander) -> bool

Trait Implementations§

Source§

impl PartialEq for dyn ProcMacroExpander

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for dyn ProcMacroExpander

Implementors§