Struct tera::Tera [] [src]

pub struct Tera {
    pub templates: HashMap<String, Template>,
    pub filters: HashMap<String, fn(Value, HashMap<String, Value>) -> TeraResult<Value>>,
    pub testers: HashMap<String, fn(&str, Option<Value>, Vec<Value>) -> TeraResult<bool>>,
    pub autoescape_extensions: Vec<&'static str>,
}

Fields

Methods

impl Tera
[src]

Renders a Tera template given a Context.

Renders a Tera template given a Serializeable object.

Register a filter with Tera. If a filter with that name already exists, it will be overwritten

Register a tester with Tera. If a tester with that name already exists, it will be overwritten

Select which extension(s) to automatically do HTML escaping on. Pass an empty vec to completely disable autoescape Note that autoescape will happen if the template name ends with one of the extensions given. Example: a file named template.html will be escaped by default but won't if you set pass [".php.html"] to that method.

Trait Implementations

impl Default for Tera
[src]

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

impl Debug for Tera
[src]

Formats the value using the given formatter.