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

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

Auto Trait Implementations

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

impl<'g> Unpin for Stack<'g>

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

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

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

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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

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

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

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

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