[−][src]Struct gluon_vm::macros::MacroEnv
Type containing macros bound to symbols which can be applied on an AST expression to transform it.
Implementations
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]
M: Macro + 'static,
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]
T: Any,
pub fn get_capability<T>(&self, thread: &Thread) -> Option<T> where
T: Any,
[src]
T: Any,
pub fn clear(&self)
[src]
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>
[src]
&'_ 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 Send for MacroEnv
impl Sync for MacroEnv
impl Unpin for MacroEnv
impl UnwindSafe for MacroEnv
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<Id> AsId<Id> for Id where
Id: ?Sized,
[src]
Id: ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<'_, T> Captures<'_> for T
[src]
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
[src]
type Remainder = Choices
pub fn subset(
self
) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>
[src]
self
) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
pub fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastArc for T where
T: Downcast + Send + Sync,
[src]
T: Downcast + Send + Sync,
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<D, T> FromPtr<D> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U, I> LiftInto<U, I> for T where
U: LiftFrom<T, I>,
[src]
U: LiftFrom<T, I>,
impl<Source> Sculptor<HNil, HNil> for Source
[src]
type Remainder = Source
pub fn sculpt(self) -> (HNil, <Source as Sculptor<HNil, HNil>>::Remainder)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,