pub struct Frontmatter { /* private fields */ }Expand description
Parsed markdown frontmatter and body.
Implementations§
Source§impl Frontmatter
impl Frontmatter
Sourcepub fn parse(content: &str) -> Result<Self, FrontmatterError>
pub fn parse(content: &str) -> Result<Self, FrontmatterError>
Parse a markdown document into frontmatter + body.
Sourcepub fn skills(&self) -> Vec<String>
pub fn skills(&self) -> Vec<String>
Read all referenced skills as a flat list (load followed by available).
Sourcepub fn skills_structured(&self) -> SkillsSpec
pub fn skills_structured(&self) -> SkillsSpec
Read skills in structured load/available form.
pub fn name(&self) -> Option<&str>
pub fn get(&self, key: &str) -> Option<&Value>
pub fn get_mut(&mut self, key: &str) -> Option<&mut Value>
Sourcepub fn set_body(&mut self, body: String)
pub fn set_body(&mut self, body: String)
Replace the Markdown body while preserving the parsed frontmatter.
pub fn has_frontmatter(&self) -> bool
Sourcepub fn insert(&mut self, key: &str, value: Value)
pub fn insert(&mut self, key: &str, value: Value)
Insert or replace a top-level frontmatter field.
pub fn remove(&mut self, key: &str) -> Option<Value>
Trait Implementations§
Source§impl Clone for Frontmatter
impl Clone for Frontmatter
Auto Trait Implementations§
impl Forget for Frontmatter
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