pub struct Template<'tpl> { /* private fields */ }
Expand description

A preprocessed form of the plain text template, ready to be rendered with data contained in types implementing the Content trait.

Implementations

Create a new Template out of the source.

  • If source is a &str, this Template will borrow it with appropriate lifetime.
  • If source is a String, this Template will take it’s ownership (The 'tpl lifetime will be 'static).

Estimate how big of a buffer should be allocated to render this Template.

Render this Template with a given Content to a String.

Render this Template with a given Content to a writer.

Render this Template with a given Content to a file.

Get a reference to a source this Template was created from.

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.