Struct iron_tera::TeraEngine

source ·
pub struct TeraEngine {
    pub tera: Tera,
}
Expand description

TeraEngine holds the Tera struct so that it can be used by many handlers without explicitly passing

Fields

tera: Tera

Implementations

compile_templates! is used to parse the contents of a dir for all templates.

Take a String and convert to a slice

Trait Implementations

The middleware implementation for TeraEngine

This is where all the magic happens. We extract TeraEngine from Iron’s Response, determine what TemplateMode we should render in, and pass the appropriate values to tera’s render methods.

Respond to an error thrown by previous AfterMiddleware, the Handler, or a BeforeMiddleware. Read more
The value type associated with this key type.
The error type associated with this plugin.
Create the plugin from an instance of the extended type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Get the TypeId of this object.