pub struct Section { /* private fields */ }Expand description
A named section in a TaskPaper doing file containing an ordered list of entries.
Sections correspond to top-level headings in the doing file format (e.g. Currently:,
Archive:). Each section holds a title and a sequence of entries that belong to it.
Implementations§
Source§impl Section
impl Section
Sourcepub fn new(title: impl Into<String>) -> Self
pub fn new(title: impl Into<String>) -> Self
Create a new section with the given title and no entries.
Sourcepub fn entries_mut(&mut self) -> &mut Vec<Entry>
pub fn entries_mut(&mut self) -> &mut Vec<Entry>
Return a mutable slice of all entries in this section.
Sourcepub fn into_entries(self) -> Vec<Entry>
pub fn into_entries(self) -> Vec<Entry>
Consume the section and return its entries.
Sourcepub fn remove_entry(&mut self, id: &str) -> usize
pub fn remove_entry(&mut self, id: &str) -> usize
Remove all entries whose ID matches the given ID, returning the number removed.
Sourcepub fn trailing_content(&self) -> &[String]
pub fn trailing_content(&self) -> &[String]
Return a slice of trailing content lines (non-entry lines after entries).
Sourcepub fn trailing_content_mut(&mut self) -> &mut Vec<String>
pub fn trailing_content_mut(&mut self) -> &mut Vec<String>
Return a mutable reference to trailing content lines.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Section
impl RefUnwindSafe for Section
impl Send for Section
impl Sync for Section
impl Unpin for Section
impl UnsafeUnpin for Section
impl UnwindSafe for Section
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