Trait askama::DynTemplate
source · pub trait DynTemplate {
// Required methods
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§
sourcefn dyn_render(&self) -> Result<String>
fn dyn_render(&self) -> Result<String>
Helper method which allocates a new String
and renders into it
sourcefn dyn_render_into(&self, writer: &mut dyn Write) -> Result<()>
fn dyn_render_into(&self, writer: &mut dyn Write) -> Result<()>
Renders the template to the given writer
fmt buffer
sourcefn dyn_write_into(&self, writer: &mut dyn Write) -> Result<()>
fn dyn_write_into(&self, writer: &mut dyn Write) -> Result<()>
Renders the template to the given writer
io buffer
sourcefn extension(&self) -> Option<&'static str>
fn extension(&self) -> Option<&'static str>
Helper function to inspect the template’s extension