Trait trillium_askama::Template
pub trait Template: Display {
const EXTENSION: Option<&'static str>;
const SIZE_HINT: usize;
const MIME_TYPE: &'static str;
// Required method
fn render_into(
&self,
writer: &mut (impl Write + ?Sized),
) -> Result<(), Error>;
// Provided methods
fn render(&self) -> Result<String, Error> { ... }
fn write_into(
&self,
writer: &mut (impl Write + ?Sized),
) -> Result<(), Error> { ... }
}
Expand description
Main Template
trait; implementations are generally derived
If you need an object-safe template, use [DynTemplate
].
Required Associated Constants§
const SIZE_HINT: usize
const SIZE_HINT: usize
Provides a rough estimate of the expanded length of the rendered template. Larger
values result in higher memory usage but fewer reallocations. Smaller values result in the
opposite. This value only affects render
. It does not take effect when calling
render_into
, write_into
, the fmt::Display
implementation, or the blanket
ToString::to_string
implementation.
Required Methods§
fn render_into(&self, writer: &mut (impl Write + ?Sized)) -> Result<(), Error>
fn render_into(&self, writer: &mut (impl Write + ?Sized)) -> Result<(), Error>
Renders the template to the given writer
fmt buffer
Provided Methods§
Object Safety§
This trait is not object safe.