Struct tera::Context
[−]
[src]
pub struct Context { /* fields omitted */ }
The struct that holds the context of a template rendering.
Light wrapper around a BTreeMap
for easier insertions of Serializable
values
Methods
impl Context
[src]
fn new() -> Context
Initializes an empty context
fn add<T: Serialize>(&mut self, key: &str, val: &T)
Converts the val
parameter to Value
and insert it into the context
let mut context = Context::new(); // user is an instance of a struct implementing `Serialize` context.add("number_users", 42);
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