[][src]Struct liquid_interpreter::Stack

pub struct Stack<'g> { /* fields omitted */ }

Stack of variables.

Methods

impl<'g> Stack<'g>
[src]

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
    S: Into<Cow<'static, str>>, 
[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
    S: Into<Cow<'static, str>>, 
[src]

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]

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]

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> Debug for Stack<'g>
[src]

Auto Trait Implementations

impl<'g> !Send for Stack<'g>

impl<'g> !Sync for Stack<'g>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: Any
[src]

impl<T> CloneAny for T where
    T: Clone + Any
[src]