pub trait DynTemplate {
    fn dyn_render(&self) -> Result<String>;
    fn dyn_render_into(&self, writer: &mut dyn Write) -> Result<()>;
    fn dyn_write_into(&self, writer: &mut dyn Write) -> Result<()>;
    fn extension(&self) -> Option<&'static str>;
    fn size_hint(&self) -> usize;
    fn mime_type(&self) -> &'static str;
}
Expand description

Object-safe wrapper trait around Template implementers

This trades reduced performance (mostly due to writing into dyn Write) for object safety.

Required Methods

Helper method which allocates a new String and renders into it

Renders the template to the given writer fmt buffer

Renders the template to the given writer io buffer

Helper function to inspect the template’s extension

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

Trait Implementations

Formats the value using the given formatter. Read more

Implementors