Skip to main content

MacroExpander

Trait MacroExpander 

Source
pub trait MacroExpander: Send + Sync {
    // Required method
    fn expand_expr(&self, cx: &mut Cx, phase: Phase, expr: Expr) -> Result<Expr>;
}
Expand description

The macro-expander contract: rewrite an Expr in a given Phase.

The kernel defines only the expansion hook; concrete macro systems and expansion strategies are supplied by libraries.

Required Methods§

Source

fn expand_expr(&self, cx: &mut Cx, phase: Phase, expr: Expr) -> Result<Expr>

Rewrites expr for the given phase, returning the expanded form.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§