[][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 get_capabilities<T>(&self, thread: &Thread) -> Vec<T> where
    T: Any
[src]

pub fn get_capability<T>(&self, thread: &Thread) -> Option<T> where
    T: Any
[src]

pub fn clear(&self)[src]

pub fn run(
    &self,
    vm: &Thread,
    user_data: &dyn Any,
    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 Trace for MacroEnv[src]

impl Default for MacroEnv[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> DowncastArc for T where
    T: Downcast + Send + Sync
[src]

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<Choices> CoproductSubsetter<CNil, HNil> for Choices[src]

type Remainder = Choices

impl<Source> Sculptor<HNil, HNil> for Source[src]

type Remainder = Source

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

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

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]