Struct minijinja::Template [−][src]
pub struct Template<'env> { /* fields omitted */ }
Expand description
Represents a handle to a template.
Templates are stored in the Environment
as bytecode instructions. With the
Environment::get_template
method that is looked up and returned in form of
this handle. Such a template can be cheaply copied as it only holds two
pointers. To render the render
method can be used.
Implementations
Renders the template into a string.
The provided value is used as the initial context for the template. It
can be any object that implements Serialize
.
Typically custom structs annotated with #[derive(Serialize)]
would
be used for this purpose.
Trait Implementations
Auto Trait Implementations
impl<'env> !RefUnwindSafe for Template<'env>
impl<'env> !UnwindSafe for Template<'env>
Blanket Implementations
Mutably borrows from an owned value. Read more