pub struct ParsedDocument {
pub preamble: String,
pub sections: Vec<(String, String)>,
pub footer: Option<String>,
}Expand description
Parsed markdown document with sections.
Fields§
§preamble: StringContent before the first section heading (preamble).
sections: Vec<(String, String)>Sections in order: (title, content).
Footer block (typically “Generated by…”), if present.
Implementations§
Source§impl ParsedDocument
impl ParsedDocument
Sourcepub fn to_content(&self) -> String
pub fn to_content(&self) -> String
Reconstruct the full markdown content.
Sourcepub fn section_titles(&self) -> Vec<&str>
pub fn section_titles(&self) -> Vec<&str>
Get section titles in order.
Sourcepub fn get_section_mut(&mut self, title: &str) -> Option<&mut String>
pub fn get_section_mut(&mut self, title: &str) -> Option<&mut String>
Get mutable reference to a section’s content by title.
Sourcepub fn add_section(&mut self, title: String, content: String)
pub fn add_section(&mut self, title: String, content: String)
Add a new section at the end.
Trait Implementations§
Source§impl Clone for ParsedDocument
impl Clone for ParsedDocument
Source§fn clone(&self) -> ParsedDocument
fn clone(&self) -> ParsedDocument
Returns a duplicate of the value. Read more
1.0.0 · 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 ParsedDocument
impl Debug for ParsedDocument
Source§impl PartialEq for ParsedDocument
impl PartialEq for ParsedDocument
impl StructuralPartialEq for ParsedDocument
Auto Trait Implementations§
impl Freeze for ParsedDocument
impl RefUnwindSafe for ParsedDocument
impl Send for ParsedDocument
impl Sync for ParsedDocument
impl Unpin for ParsedDocument
impl UnsafeUnpin for ParsedDocument
impl UnwindSafe for ParsedDocument
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