[−][src]Struct liquid::interpreter::Stack
Stack of variables.
Methods
impl<'g> Stack<'g>
[src]
pub fn empty() -> Stack<'g>
[src]
Create an empty stack
pub fn with_globals(globals: &'g (dyn ValueStore + 'g)) -> Stack<'g>
[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: &[ScalarCow]) -> Option<&Value>
[src]
Recursively index into the stack.
pub fn get(&self, path: &[ScalarCow]) -> Result<&Value, Error>
[src]
Recursively index into the stack.
pub fn set_index<S>(&mut self, name: S, val: Value) -> Option<Value> where
S: Into<Cow<'static, str>>,
[src]
S: Into<Cow<'static, str>>,
Used by increment and decrement tags
pub fn get_index(&'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
S: Into<Cow<'static, str>>,
[src]
S: Into<Cow<'static, str>>,
Sets a value in the global context.
pub fn set<S>(&mut self, name: S, val: Value) -> Option<Value> where
S: Into<Cow<'static, str>>,
[src]
S: Into<Cow<'static, str>>,
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> Default for Stack<'g>
[src]
impl<'g> Debug for Stack<'g>
[src]
impl<'g> Clone for Stack<'g>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
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]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> CloneAny for T where
T: Clone + Any,
T: Clone + Any,