pub struct List {
    pub tasks: Vec<Task>,
}Fields§
§tasks: Vec<Task>Implementations§
Source§impl List
 
impl List
pub fn new(tasks: Vec<Task>) -> List
Sourcepub fn current<'a>(&'a mut self) -> Option<&'a mut Task>
 
pub fn current<'a>(&'a mut self) -> Option<&'a mut Task>
Return a reference to the “current” task.
Sourcepub fn add_multiple(&mut self, tasks: &mut Vec<Task>)
 
pub fn add_multiple(&mut self, tasks: &mut Vec<Task>)
Add multiple tasks to the List, this is more efficient than calling add multiple times since only one sort is performed. It will empty the given vector.
Sourcepub fn find_by_ind<'a>(&'a mut self, id: usize) -> Option<&'a mut Task>
 
pub fn find_by_ind<'a>(&'a mut self, id: usize) -> Option<&'a mut Task>
Return a reference to the task at the given ID / index.
Sourcepub fn find_by_title<'a>(&'a mut self, title: &str) -> Option<&'a mut Task>
 
pub fn find_by_title<'a>(&'a mut self, title: &str) -> Option<&'a mut Task>
Return a reference to the first task with the given title.
Sourcepub fn enumerate(&self) -> Enumerate<Iter<'_, Task>>
 
pub fn enumerate(&self) -> Enumerate<Iter<'_, Task>>
Return an enumerated iterator over the tasks in this list.
pub fn to_json(&self) -> Result<String, Error>
pub fn context(&self, context: &str) -> List
pub fn search<'a>(&'a mut self, query: AST) -> Vec<&'a Task>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for List
 
impl<'de> Deserialize<'de> for List
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
 
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl IntoIterator for List
 
impl IntoIterator for List
impl StructuralPartialEq for List
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