Trait liquid_core::runtime::Runtime
source · pub trait Runtime {
// Required methods
fn partials(&self) -> &dyn PartialStore;
fn name(&self) -> Option<KStringRef<'_>>;
fn roots(&self) -> BTreeSet<KStringCow<'_>>;
fn try_get(&self, path: &[ScalarCow<'_>]) -> Option<ValueCow<'_>>;
fn get(&self, path: &[ScalarCow<'_>]) -> Result<ValueCow<'_>>;
fn set_global(&self, name: KString, val: Value) -> Option<Value>;
fn set_index(&self, name: KString, val: Value) -> Option<Value>;
fn get_index<'a>(&'a self, name: &str) -> Option<ValueCow<'a>>;
fn registers(&self) -> &Registers;
}
Expand description
State for rendering a template
Required Methods§
sourcefn partials(&self) -> &dyn PartialStore
fn partials(&self) -> &dyn PartialStore
Partial templates for inclusion.
sourcefn name(&self) -> Option<KStringRef<'_>>
fn name(&self) -> Option<KStringRef<'_>>
The name of the currently active template.
sourcefn roots(&self) -> BTreeSet<KStringCow<'_>>
fn roots(&self) -> BTreeSet<KStringCow<'_>>
All available values
sourcefn try_get(&self, path: &[ScalarCow<'_>]) -> Option<ValueCow<'_>>
fn try_get(&self, path: &[ScalarCow<'_>]) -> Option<ValueCow<'_>>
Recursively index into the stack.
sourcefn get(&self, path: &[ScalarCow<'_>]) -> Result<ValueCow<'_>>
fn get(&self, path: &[ScalarCow<'_>]) -> Result<ValueCow<'_>>
Recursively index into the stack.
sourcefn set_global(&self, name: KString, val: Value) -> Option<Value>
fn set_global(&self, name: KString, val: Value) -> Option<Value>
Sets a value in the global runtime.
sourcefn set_index(&self, name: KString, val: Value) -> Option<Value>
fn set_index(&self, name: KString, val: Value) -> Option<Value>
Used by increment and decrement tags