pub struct TemplateBase<TE: TemplateEngine> { /* private fields */ }Expand description
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::Sourcewith a iri using thepathscheme and the string content as the iris “tail”.
Implementations§
Source§impl<TE> TemplateBase<TE>where
TE: TemplateEngine,
impl<TE> TemplateBase<TE>where
TE: TemplateEngine,
Trait Implementations§
Source§impl<TE: Debug + TemplateEngine> Debug for TemplateBase<TE>where
TE::LazyBodyTemplate: Debug,
impl<TE: Debug + TemplateEngine> Debug for TemplateBase<TE>where
TE::LazyBodyTemplate: Debug,
Source§impl<'de, TE: TemplateEngine> Deserialize<'de> for TemplateBase<TE>
impl<'de, TE: TemplateEngine> Deserialize<'de> for TemplateBase<TE>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<TE: TemplateEngine> Serialize for TemplateBase<TE>
impl<TE: TemplateEngine> Serialize for TemplateBase<TE>
Auto Trait Implementations§
impl<TE> Freeze for TemplateBase<TE>
impl<TE> RefUnwindSafe for TemplateBase<TE>
impl<TE> Send for TemplateBase<TE>
impl<TE> Sync for TemplateBase<TE>
impl<TE> Unpin for TemplateBase<TE>
impl<TE> UnwindSafe for TemplateBase<TE>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more