StandardLazyBodyTemplate

Struct StandardLazyBodyTemplate 

Source
pub struct StandardLazyBodyTemplate {
    pub path: PathBuf,
    pub embeddings: HashMap<String, Resource>,
    pub media_type: Option<MediaType>,
}
Expand description

Common implementation for a type for TemplateEngine::LazyBodyTemplate.

This impl. gives bodies a field embeddings which is a mapping of embedding names to embeddings (using deserialize_embeddings) a path field which allows specifying the template file (e.g. "body.html") and can be relative to the base dir.

Fields§

§path: PathBuf§embeddings: HashMap<String, Resource>§media_type: Option<MediaType>

Trait Implementations§

Source§

impl Debug for StandardLazyBodyTemplate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for StandardLazyBodyTemplate

Source§

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 PathRebaseable for StandardLazyBodyTemplate

Source§

fn rebase_to_include_base_dir( &mut self, base_dir: impl AsRef<Path>, ) -> Result<(), UnsupportedPathError>

Prefixes path in the type with base_dir. Read more
Source§

fn rebase_to_exclude_base_dir( &mut self, base_dir: impl AsRef<Path>, ) -> Result<(), UnsupportedPathError>

Removes the base_dir prefix. Read more
Source§

impl Serialize for StandardLazyBodyTemplate

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HeaderTryFrom<T> for T

Source§

impl<F, T> HeaderTryInto<T> for F
where T: HeaderTryFrom<F>,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

impl<T> Erased for T