pub trait TemplateExt<TE, D>where
TE: TemplateEngine + TemplateEngineCanHandleData<D>,{
// Required method
fn render_to_mail_parts<'r>(
&self,
data: LoadedTemplateData<'r, D>,
ctx: &impl Context,
) -> Result<(MailParts, Header<Subject>), Error>;
// Provided method
fn render<'r>(
&self,
data: LoadedTemplateData<'r, D>,
ctx: &impl Context,
) -> Result<Mail, Error> { ... }
}Expand description
Automatically provides the prepare_to_render method for all Templates
This trait is implemented for all Templates/D(data) combinations where
the templates template engine can handle the given data (impl. TemplateEngineCanHandleData<D>)
This trait should not be implemented by hand.
Required Methods§
fn render_to_mail_parts<'r>( &self, data: LoadedTemplateData<'r, D>, ctx: &impl Context, ) -> Result<(MailParts, Header<Subject>), Error>
Provided Methods§
fn render<'r>( &self, data: LoadedTemplateData<'r, D>, ctx: &impl Context, ) -> Result<Mail, Error>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.