Struct rune::MacroContext [−][src]
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]
T: ResolveOwned,
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]
&self,
target: &T
) -> Result<<T::Output as IrEval>::Output, IrError> where
T: Spanned + IrCompile,
T::Output: IrEval,
Evaluate the given ast as a constant expression.
pub fn stringify<'a, T>(&'a self, tokens: &T) -> Stringify<'_> where
T: ToTokens,
[src]
T: ToTokens,
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
impl !RefUnwindSafe for MacroContext
impl !Send for MacroContext
impl !Sync for MacroContext
impl Unpin for MacroContext
impl !UnwindSafe for MacroContext
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,