Struct liquid_interpreter::Stack [−][src]
pub struct Stack<'g> { /* fields omitted */ }Stack of variables.
Methods
impl<'g> Stack<'g>[src]
impl<'g> Stack<'g>pub fn empty() -> Self[src]
pub fn empty() -> SelfCreate an empty stack
pub fn with_globals(globals: &'g Globals) -> Self[src]
pub fn with_globals(globals: &'g Globals) -> SelfCreate a stack initialized with read-only Globals.
pub fn get(&self, path: &Path) -> Result<&Value>[src]
pub fn get(&self, path: &Path) -> Result<&Value>Recursively index into the stack.
pub fn set_global<S>(&mut self, name: S, val: Value) -> Option<Value> where
S: Into<Cow<'static, str>>, [src]
pub fn set_global<S>(&mut self, name: S, val: Value) -> Option<Value> where
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]
pub fn set<S>(&mut self, name: S, val: Value) -> Option<Value> where
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> Debug for Stack<'g>[src]
impl<'g> Debug for Stack<'g>fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<'g> Clone for Stack<'g>[src]
impl<'g> Clone for Stack<'g>fn clone(&self) -> Stack<'g>[src]
fn clone(&self) -> Stack<'g>Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[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>