Struct rune::MacroContext[][src]

pub struct MacroContext { /* fields omitted */ }

Context for a running macro.

Implementations

impl MacroContext[src]

pub fn empty() -> Self[src]

Construct an empty macro context. Should only be used for testing.

pub fn resolve_owned<T>(&self, item: T) -> Result<T::Owned, ResolveError> where
    T: ResolveOwned
[src]

Resolve the given item into an owned variant.

pub fn eval<T>(
    &self,
    target: &T
) -> Result<<T::Output as IrEval>::Output, IrError> where
    T: Spanned + IrCompile,
    T::Output: IrEval, 
[src]

Evaluate the given ast as a constant expression.

pub fn stringify<'a, T>(&'a self, tokens: &T) -> Stringify<'_> where
    T: ToTokens
[src]

Stringify the given token stream.

pub fn macro_span(&self) -> Span[src]

Access span of the whole macro.

pub fn stream_span(&self) -> Span[src]

Access the span of the stream being parsed.

pub fn storage(&self) -> &Storage[src]

Access storage for the macro system.

pub fn source(&self) -> &Source[src]

Access the current source of the macro context.

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.