pub struct List {
pub path: Option<String>,
pub lines: Vec<Line>,
}
Expand description
A todo list.
Fields§
§path: Option<String>
§lines: Vec<Line>
Implementations§
Source§impl List
impl List
pub fn new() -> Self
pub fn from_items(lines: Vec<&Item>) -> Self
Sourcepub fn from_filename(path: String) -> Result<Self, Error>
pub fn from_filename(path: String) -> Result<Self, Error>
Parse a todo list from a filename.
Sourcepub fn from_string(s: String) -> Result<Self, Error>
pub fn from_string(s: String) -> Result<Self, Error>
Parse a todo list from a string.
pub fn to_url(&self, u: String)
Sourcepub fn to_filename(&self, path: String)
pub fn to_filename(&self, path: String)
Save a todo list to a filename.
Sourcepub fn append_lines_to_url(u: String, lines: Vec<&Line>)
pub fn append_lines_to_url(u: String, lines: Vec<&Line>)
Appends some lines to a todo list, given its filename.
Sourcepub fn count_items(&self) -> usize
pub fn count_items(&self) -> usize
Count the items in the list.
Sourcepub fn count_blank(&self) -> usize
pub fn count_blank(&self) -> usize
Count the blank/comment lines in the list.
Sourcepub fn count_completed(&self) -> usize
pub fn count_completed(&self) -> usize
Count the completed items in the list.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for List
impl RefUnwindSafe for List
impl Send for List
impl Sync for List
impl Unpin for List
impl UnwindSafe for List
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