Struct liquid_interpreter::Context
source · 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 get_filter<'b>(&'b self, name: &str) -> Option<&'b dyn FilterValue>
pub fn get_filter<'b>(&'b self, name: &str) -> Option<&'b dyn FilterValue>
Grab a FilterValue
.
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 cycles<'a>(&'a mut self) -> CycleState<'a, 'g>where
'g: 'a,
pub fn cycles<'a>(&'a mut self) -> CycleState<'a, 'g>where
'g: 'a,
See cycle
tag.
sourcepub fn ifchanged(&mut self) -> &mut IfChangedState
pub fn ifchanged(&mut self) -> &mut IfChangedState
Access the block’s IfChangedState
.
sourcepub fn run_in_scope<RvalT, FnT>(&mut self, f: FnT) -> RvalTwhere
FnT: FnOnce(&mut Context<'_>) -> RvalT,
pub fn run_in_scope<RvalT, FnT>(&mut self, f: FnT) -> RvalTwhere
FnT: FnOnce(&mut Context<'_>) -> 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.