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: PathBufembeddings: HashMap<String, Resource>media_type: Option<MediaType>Trait Implementations
sourceimpl Debug for StandardLazyBodyTemplate
impl Debug for StandardLazyBodyTemplate
sourceimpl<'de> Deserialize<'de> for StandardLazyBodyTemplate
impl<'de> Deserialize<'de> for StandardLazyBodyTemplate
sourcefn 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
sourceimpl PathRebaseable for StandardLazyBodyTemplate
impl PathRebaseable for StandardLazyBodyTemplate
sourcefn 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 moresourcefn 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 moresourceimpl Serialize for StandardLazyBodyTemplate
impl Serialize for StandardLazyBodyTemplate
Auto Trait Implementations
impl RefUnwindSafe for StandardLazyBodyTemplate
impl Send for StandardLazyBodyTemplate
impl Sync for StandardLazyBodyTemplate
impl Unpin for StandardLazyBodyTemplate
impl UnwindSafe for StandardLazyBodyTemplate
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more