[][src]Trait mail_template::TemplateExt

pub trait TemplateExt<TE, D> where
    TE: TemplateEngine + TemplateEngineCanHandleData<D>, 
{ fn render_to_mail_parts<'r>(
        &self,
        data: LoadedTemplateData<'r, D>,
        ctx: &impl Context
    ) -> Result<(MailParts, Header<Subject>), Error>; fn render<'r>(
        &self,
        data: LoadedTemplateData<'r, D>,
        ctx: &impl Context
    ) -> Result<Mail, Error> { ... } }

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>

Loading content...

Provided methods

fn render<'r>(
    &self,
    data: LoadedTemplateData<'r, D>,
    ctx: &impl Context
) -> Result<Mail, Error>

Loading content...

Implementors

impl<TE, D> TemplateExt<TE, D> for Template<TE> where
    TE: TemplateEngine + TemplateEngineCanHandleData<D>, 
[src]

fn render<'r>(
    &self,
    data: LoadedTemplateData<'r, D>,
    ctx: &impl Context
) -> Result<Mail, Error>
[src]

Loading content...