pub struct Metadata { /* private fields */ }Expand description
Extra information declared outside template file.
Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn from_attrs(attrs: &[Attribute], conf: &Config) -> Result<Metadata>
pub fn from_attrs(attrs: &[Attribute], conf: &Config) -> Result<Metadata>
Create metadata by parsing Attribute.
Sourcepub fn clone_as_import(&self, path: impl AsRef<Path>) -> Metadata
pub fn clone_as_import(&self, path: impl AsRef<Path>) -> Metadata
Create Metadata with given path inherited from parent meta.
This will set TemplKind to TemplKind::Import.
Sourcepub fn clone_as_layout(&self, layout: &LayoutTempl) -> Metadata
pub fn clone_as_layout(&self, layout: &LayoutTempl) -> Metadata
Generate layout Metadata inherited from parent meta.
This will set TemplKind to TemplKind::Layout.
Sourcepub fn resolve_source(&self) -> Result<Cow<'_, str>>
pub fn resolve_source(&self) -> Result<Cow<'_, str>>
Returns inlined source or read source from filesystem.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl !Send for Metadata
impl !Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
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