pub trait LispMacro: Send + Sync {
// Required methods
fn symbol(&self) -> Symbol;
fn syntax_shape(&self) -> Arc<dyn Shape>;
fn expand(
&self,
cx: &mut MacroCx<'_>,
input: Expr,
captures: Bindings,
) -> Result<Expr>;
}Expand description
Contract for an expandable macro: its name, its syntax shape, and the expansion that rewrites a matched form into a new expression.
Required Methods§
Sourcefn syntax_shape(&self) -> Arc<dyn Shape>
fn syntax_shape(&self) -> Arc<dyn Shape>
Returns the shape the macro’s call syntax must match.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".