[][src]Trait liquid_interpreter::ValueStore

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

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: PathRef) -> 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>(&'a self, path: PathRef) -> 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>(&'a self, path: PathRef) -> Result<&'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.
Loading content...

Implementations on Foreign Types

impl ValueStore for Object[src]

Loading content...

Implementors

Loading content...