pub struct Context<'g> { /* private fields */ }
Expand description
Processing context for a template.
Implementations§
Source§impl<'g> Context<'g>
impl<'g> Context<'g>
Sourcepub fn interrupt(&self) -> &InterruptState
pub fn interrupt(&self) -> &InterruptState
Access the block’s InterruptState
.
Sourcepub fn interrupt_mut(&mut self) -> &mut InterruptState
pub fn interrupt_mut(&mut self) -> &mut InterruptState
Access the block’s InterruptState
.
Sourcepub fn partials(&self) -> &dyn PartialStore
pub fn partials(&self) -> &dyn PartialStore
Partial templates for inclusion.
Sourcepub fn get_register_mut<T: IntoBox<dyn Any> + Default>(&mut self) -> &mut T
pub fn get_register_mut<T: IntoBox<dyn Any> + Default>(&mut self) -> &mut T
Data store for stateful tags/blocks.
If a plugin needs state, it creates a struct State : Default
and accesses it via
get_register_mut
.
Sourcepub fn run_in_scope<RvalT, FnT>(&mut self, f: FnT) -> RvalT
pub fn run_in_scope<RvalT, FnT>(&mut self, f: FnT) -> RvalT
Sets up a new stack frame, executes the supplied function and then tears the stack frame down before returning the function’s result to the caller.
Trait Implementations§
Auto Trait Implementations§
impl<'g> Freeze for Context<'g>
impl<'g> !RefUnwindSafe for Context<'g>
impl<'g> !Send for Context<'g>
impl<'g> !Sync for Context<'g>
impl<'g> Unpin for Context<'g>
impl<'g> !UnwindSafe for Context<'g>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more