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
impl Debug for StandardLazyBodyTemplate
Source§impl<'de> Deserialize<'de> for StandardLazyBodyTemplate
impl<'de> Deserialize<'de> for StandardLazyBodyTemplate
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 PathRebaseable for StandardLazyBodyTemplate
impl PathRebaseable for StandardLazyBodyTemplate
Source§fn rebase_to_include_base_dir(
&mut self,
base_dir: impl AsRef<Path>,
) -> Result<(), UnsupportedPathError>
fn rebase_to_include_base_dir( &mut self, base_dir: impl AsRef<Path>, ) -> Result<(), UnsupportedPathError>
Prefixes path in the type with
base_dir. Read moreSource§fn rebase_to_exclude_base_dir(
&mut self,
base_dir: impl AsRef<Path>,
) -> Result<(), UnsupportedPathError>
fn rebase_to_exclude_base_dir( &mut self, base_dir: impl AsRef<Path>, ) -> Result<(), UnsupportedPathError>
Removes the
base_dir prefix. Read moreAuto Trait Implementations§
impl Freeze for StandardLazyBodyTemplate
impl RefUnwindSafe for StandardLazyBodyTemplate
impl Send for StandardLazyBodyTemplate
impl Sync for StandardLazyBodyTemplate
impl Unpin for StandardLazyBodyTemplate
impl UnwindSafe for StandardLazyBodyTemplate
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