pub trait Template {
    const EXTENSION: Option<&'static str>;
    const SIZE_HINT: usize;
    const MIME_TYPE: &'static str;

    fn render_into(&self, writer: &mut impl Write) -> Result<(), Error>;

    fn render(&self) -> Result<String, Error> { ... }
}
Expand description

Main Template trait; implementations are generally derived

If you need an object-safe template, use [DynTemplate].

Required Associated Constants

The template’s extension, if provided

Provides a conservative estimate of the expanded length of the rendered template

The MIME type (Content-Type) of the data that gets rendered by this Template

Required Methods

Renders the template to the given writer buffer

Provided Methods

Helper method which allocates a new String and renders into it

Implementors