pub struct Frontmatter {
pub map: Mapping,
}Expand description
Parsed frontmatter, retaining the full YAML mapping so verify can inspect
wrong-typed values (rather than failing to parse them).
Fields§
§map: MappingImplementations§
Source§impl Frontmatter
impl Frontmatter
pub fn new() -> Self
pub fn get(&self, key: &str) -> Option<&Value>
pub fn contains_key(&self, key: &str) -> bool
pub fn keys(&self) -> impl Iterator<Item = &str>
Sourcepub fn get_str(&self, key: &str) -> Option<&str>
pub fn get_str(&self, key: &str) -> Option<&str>
String value of key, only if it is actually a YAML string.
pub fn id(&self) -> Option<&str>
pub fn status(&self) -> Option<&str>
tags as a list of strings, when it is a sequence whose elements are
all strings. Returns None if absent or wrong-shaped (verify reports).
True when tags is present and is a non-empty sequence.
Sourcepub fn has_tag(&self, query: &str) -> bool
pub fn has_tag(&self, query: &str) -> bool
True when the document carries query as a tag — either an exact tag, or
any tag whose key (the head before : or =) equals query. So area
matches area, area:parsing, and area=high.
pub fn set_str(&mut self, key: &str, value: impl Into<String>)
pub fn insert(&mut self, key: &str, value: Value)
pub fn remove(&mut self, key: &str) -> Option<Value>
Trait Implementations§
Source§impl Clone for Frontmatter
impl Clone for Frontmatter
Source§fn clone(&self) -> Frontmatter
fn clone(&self) -> Frontmatter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Frontmatter
impl Debug for Frontmatter
Source§impl Default for Frontmatter
impl Default for Frontmatter
Source§fn default() -> Frontmatter
fn default() -> Frontmatter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Frontmatter
impl RefUnwindSafe for Frontmatter
impl Send for Frontmatter
impl Sync for Frontmatter
impl Unpin for Frontmatter
impl UnsafeUnpin for Frontmatter
impl UnwindSafe for Frontmatter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more