Struct gluon_vm::macros::MacroEnv [−][src]
pub struct MacroEnv { /* fields omitted */ }
Expand description
Type containing macros bound to symbols which can be applied on an AST expression to transform it.
Implementations
Inserts a Macro
which acts on any occurance of symbol
when applied to an expression.
pub async fn run<'ast>(
&self,
vm: &Thread,
userdata: &mut (dyn MacroUserdata + '_),
spawn: Option<&(dyn Spawn + Send + Sync + '_)>,
symbols: &mut Symbols,
arena: OwnedArena<'ast, Symbol>,
expr: &'ast mut SpannedExpr<'ast, Symbol>
) -> Result<(), Errors>
pub async fn run<'ast>(
&self,
vm: &Thread,
userdata: &mut (dyn MacroUserdata + '_),
spawn: Option<&(dyn Spawn + Send + Sync + '_)>,
symbols: &mut Symbols,
arena: OwnedArena<'ast, Symbol>,
expr: &'ast mut SpannedExpr<'ast, Symbol>
) -> Result<(), Errors>
Runs the macros in this MacroEnv
on expr
using env
as the context of the expansion
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for MacroEnv
impl UnwindSafe for MacroEnv
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more