[][src]Struct gluon_vm::macros::MacroEnv

pub struct MacroEnv { /* fields omitted */ }

Type containing macros bound to symbols which can be applied on an AST expression to transform it.

Methods

impl MacroEnv[src]

pub fn new() -> MacroEnv[src]

Creates a new MacroEnv

pub fn insert<M>(&self, name: String, mac: M) where
    M: Macro + 'static, 
[src]

Inserts a Macro which acts on any occurance of symbol when applied to an expression.

pub fn get(&self, name: &str) -> Option<Arc<dyn Macro>>[src]

Retrieves the macro bound to symbol

pub fn run(
    &self,
    vm: &Thread,
    symbols: &mut Symbols,
    expr: &mut SpannedExpr<Symbol>
) -> Result<(), Errors>
[src]

Runs the macros in this MacroEnv on expr using env as the context of the expansion

Trait Implementations

impl Default for MacroEnv[src]

Auto Trait Implementations

impl Send for MacroEnv

impl Sync for MacroEnv

Blanket Implementations

impl<D, T> FromPtr for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<Choices> CoproductSubsetter for Choices[src]

type Remainder = Choices

impl<Source> Sculptor for Source[src]

type Remainder = Source

impl<T, U, I> LiftInto for T where
    U: LiftFrom<T, I>, 
[src]

impl<T> Any for T where
    T: Any
[src]