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]

Initializes an empty context

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]

Formats the value using the given formatter.

impl Clone for Context
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for Context
[src]

Returns the "default value" for a type. Read more