[−][src]Struct liquid_interpreter::Stack
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]
S: Into<Cow<'static, str>>,
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]
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> Clone for Stack<'g>
[src]
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> 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]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
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<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
[src]
T: Any,
impl<T> CloneAny for T where
T: Clone + Any,
[src]
T: Clone + Any,