Trait askama::DynTemplate
source · [−]pub trait DynTemplate {
fn dyn_render(&self) -> Result<String, Error>;
fn dyn_render_into(&self, writer: &mut dyn Write) -> Result<(), Error>;
fn dyn_write_into(&self, writer: &mut dyn Write) -> Result<(), Error>;
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
fn dyn_render(&self) -> Result<String, Error>
fn dyn_render(&self) -> Result<String, Error>
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