[][src]Trait liquid::ValueStore

pub trait ValueStore: Debug {
    fn contains_root(&self, name: &str) -> bool;
fn roots(&self) -> Vec<&str>;
fn contains_variable(&self, path: &[ScalarCow]) -> bool;
fn try_get_variable(&'a self, path: &[ScalarCow]) -> Option<&'a Value>;
fn get_variable(&'a self, path: &[ScalarCow]) -> Result<&'a Value, Error>; }

Immutable view into a template's global variables.

Required methods

fn contains_root(&self, name: &str) -> bool

Check if root variable exists.

fn roots(&self) -> Vec<&str>

Enumerate all root variables.

fn contains_variable(&self, path: &[ScalarCow]) -> bool

Check if variable exists.

Notes to implementers:

  • Don't forget to reverse-index on negative array indexes
  • Don't forget about arr.first, arr.last.

fn try_get_variable(&'a self, path: &[ScalarCow]) -> Option<&'a Value>

Access a variable.

Notes to implementers:

  • Don't forget to reverse-index on negative array indexes
  • Don't forget about arr.first, arr.last.

fn get_variable(&'a self, path: &[ScalarCow]) -> Result<&'a Value, Error>

Access a variable.

Notes to implementers:

  • Don't forget to reverse-index on negative array indexes
  • Don't forget about arr.first, arr.last.
Loading content...

Implementors

impl ValueStore for Map[src]

Loading content...