[−][src]Trait gluon_vm::macros::Macro
A trait which abstracts over macros.
A macro is similiar to a function call but is run at compile time instead of at runtime.
Required methods
fn expand<'r, 'a: 'r, 'b: 'r, 'ast: 'r>(
&self,
env: &'b mut MacroExpander<'a>,
arena: &'b mut OwnedArena<'ast, Symbol>,
args: &'b mut [SpannedExpr<'ast, Symbol>]
) -> MacroFuture<'r, 'ast>
&self,
env: &'b mut MacroExpander<'a>,
arena: &'b mut OwnedArena<'ast, Symbol>,
args: &'b mut [SpannedExpr<'ast, Symbol>]
) -> MacroFuture<'r, 'ast>
Provided methods
fn get_capability<T>(
&self,
thread: &Thread,
arc_self: &Arc<dyn Macro>
) -> Option<T> where
Self: Sized,
T: Any,
&self,
thread: &Thread,
arc_self: &Arc<dyn Macro>
) -> Option<T> where
Self: Sized,
T: Any,
fn get_capability_impl(
&self,
thread: &Thread,
arc_self: &Arc<dyn Macro>,
id: TypeId
) -> Option<Box<dyn Any>>
&self,
thread: &Thread,
arc_self: &Arc<dyn Macro>,
id: TypeId
) -> Option<Box<dyn Any>>
Methods
impl dyn Macro
[src]
pub fn is<__T: Macro>(&self) -> bool
[src]
Returns true if the trait object wraps an object of type __T
.
pub fn downcast<__T: Macro>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>
[src]
Returns a boxed object from a boxed trait object if the underlying object is of type
__T
. Returns the original boxed trait if it isn't.
pub fn downcast_rc<__T: Macro>(self: Rc<Self>) -> Result<Rc<__T>, Rc<Self>>
[src]
Returns an Rc
-ed object from an Rc
-ed trait object if the underlying object is of
type __T
. Returns the original Rc
-ed trait if it isn't.
pub fn downcast_ref<__T: Macro>(&self) -> Option<&__T>
[src]
Returns a reference to the object within the trait object if it is of type __T
, or
None
if it isn't.
pub fn downcast_mut<__T: Macro>(&mut self) -> Option<&mut __T>
[src]
Returns a mutable reference to the object within the trait object if it is of type
__T
, or None
if it isn't.
impl dyn Macro
[src]
pub fn downcast_arc<T: Macro>(self: Arc<Self>) -> Result<Arc<T>, Arc<Self>> where
Self: Send + Sync,
[src]
Self: Send + Sync,
Implementations on Foreign Types
impl<M: ?Sized> Macro for Box<M> where
M: Macro,
[src]
M: Macro,
fn get_capability_impl(
&self,
thread: &Thread,
arc_self: &Arc<dyn Macro>,
id: TypeId
) -> Option<Box<dyn Any>>
[src]
&self,
thread: &Thread,
arc_self: &Arc<dyn Macro>,
id: TypeId
) -> Option<Box<dyn Any>>
fn expand<'r, 'a: 'r, 'b: 'r, 'ast: 'r>(
&self,
env: &'b mut MacroExpander<'a>,
arena: &'b mut OwnedArena<'ast, Symbol>,
args: &'b mut [SpannedExpr<'ast, Symbol>]
) -> MacroFuture<'r, 'ast>
[src]
&self,
env: &'b mut MacroExpander<'a>,
arena: &'b mut OwnedArena<'ast, Symbol>,
args: &'b mut [SpannedExpr<'ast, Symbol>]
) -> MacroFuture<'r, 'ast>
impl<M: ?Sized> Macro for Arc<M> where
M: Macro,
[src]
M: Macro,
fn get_capability_impl(
&self,
thread: &Thread,
arc_self: &Arc<dyn Macro>,
id: TypeId
) -> Option<Box<dyn Any>>
[src]
&self,
thread: &Thread,
arc_self: &Arc<dyn Macro>,
id: TypeId
) -> Option<Box<dyn Any>>
fn expand<'r, 'a: 'r, 'b: 'r, 'ast: 'r>(
&self,
env: &'b mut MacroExpander<'a>,
arena: &'b mut OwnedArena<'ast, Symbol>,
args: &'b mut [SpannedExpr<'ast, Symbol>]
) -> MacroFuture<'r, 'ast>
[src]
&self,
env: &'b mut MacroExpander<'a>,
arena: &'b mut OwnedArena<'ast, Symbol>,
args: &'b mut [SpannedExpr<'ast, Symbol>]
) -> MacroFuture<'r, 'ast>