[−][src]Struct liquid_interpreter::Stack
Stack of variables.
Methods
impl<'g> Stack<'g>
[src]
impl<'g> Stack<'g>
pub fn empty() -> Self | [src] |
Create an empty stack
pub fn with_globals(globals: &'g dyn ValueStore) -> Self | [src] |
Create a stack initialized with read-only ValueStore
.
pub fn frame_name(&self) -> Option<&str> | [src] |
The name of the currently active template.
pub fn try_get(&self, path: PathRef) -> Option<&Value> | [src] |
Recursively index into the stack.
pub fn get(&self, path: PathRef) -> Result<&Value> | [src] |
Recursively index into the stack.
pub fn set_index<S>(&mut self, name: S, val: Value) -> Option<Value> where | [src] |
Used by increment and decrement tags
pub fn get_index<'a>(&'a self, name: &str) -> Option<&'a Value> | [src] |
Used by increment and decrement tags
pub fn set_global<S>(&mut self, name: S, val: Value) -> Option<Value> where | [src] |
Sets a value in the global context.
pub fn set<S>(&mut self, name: S, val: Value) -> Option<Value> where | [src] |
Sets a value to the rendering context. Note that it needs to be wrapped in a liquid::Value.
Panics
Panics if there is no frame on the local values stack. Context instances are created with a top-level stack frame in place, so this should never happen in a well-formed program.
Trait Implementations
impl<'g> Clone for Stack<'g>
[src]
impl<'g> Clone for Stack<'g>
fn clone(&self) -> Stack<'g> | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl<'g> Default for Stack<'g>
[src]
impl<'g> Default for Stack<'g>
impl<'g> Debug for Stack<'g>
[src]
impl<'g> Debug for Stack<'g>
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T> Any for T where
T: Any,
[src]
impl<T> Any for T where
T: Any,
impl<T> CloneAny for T where
T: Clone + Any,
[src]
impl<T> CloneAny for T where
T: Clone + Any,