[][src]Struct mail_template::serde_impl::TemplateBase

pub struct TemplateBase<TE: TemplateEngine> { /* fields omitted */ }

Type used when deserializing a template using serde.

This type should only be used as intermediate type used for deserialization as templates need to be bundled with a template engine.

Serialize/Deserialize

The derserialization currently only works with self-describing data formats.

There are a number of shortcuts to deserialize resources (from emebddings and/or attachments):

  • Resources can be deserialized normally (from a externally tagged enum)
  • Resources can be deserialized from the serialized repr of Source
  • Resources can be deserialized from a string which is used to create a Resource::Source with a iri using the path scheme and the string content as the iris "tail".

Methods

impl<TE> TemplateBase<TE> where
    TE: TemplateEngine
[src]

pub fn load(
    self,
    engine: TE,
    default_base_dir: CwdBaseDir,
    ctx: &impl Context
) -> impl Future<Item = Template<TE>, Error = Error>
[src]

Couples the template base with a specific engine instance.``

Trait Implementations

impl<TE: Debug + TemplateEngine> Debug for TemplateBase<TE> where
    TE::LazyBodyTemplate: Debug
[src]

impl<TE: TemplateEngine> Serialize for TemplateBase<TE>[src]

impl<'de, TE: TemplateEngine> Deserialize<'de> for TemplateBase<TE>[src]

Auto Trait Implementations

impl<TE> Send for TemplateBase<TE> where
    <TE as TemplateEngine>::LazyBodyTemplate: Send

impl<TE> Sync for TemplateBase<TE> where
    <TE as TemplateEngine>::LazyBodyTemplate: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> HeaderTryFrom for T[src]

impl<F, T> HeaderTryInto for F where
    T: HeaderTryFrom<F>, 
[src]

impl<T> Erased for T