Struct handlebars::Context
[−]
[src]
pub struct Context { /* fields omitted */ }
The context wrap data you render on your templates.
Methods
impl Context
[src]
fn null() -> Context
Create a context with null data
fn wraps<T: ToJson>(e: &T) -> Context
Create a context with given data
fn extend(&self, hash: &BTreeMap<String, Json>) -> Context
Extend current context with another JSON object
If current context is a JSON object, it's identical to a normal merge
Otherwise, the current value will be stored in new JSON object with key this
, and merged
keys are also available.
Navigate the context with base path and relative path
Typically you will set base path to RenderContext.get_path()
and set relative path to helper argument or so.
If you want to navigate from top level, set the base path to "."
fn data(&self) -> &Json
fn data_mut(&mut self) -> &mut Json
Trait Implementations
impl Debug for Context
[src]
impl Clone for Context
[src]
fn clone(&self) -> Context
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more