pub struct Todo {
pub days: HashMap<NaiveDate, Day>,
pub file_path: PathBuf,
}Fields§
§days: HashMap<NaiveDate, Day>§file_path: PathBufImplementations§
Source§impl Todo
impl Todo
pub fn new(path: Option<&str>) -> Result<Todo, Box<dyn Error + Send + Sync>>
Sourcepub fn next_day(&mut self)
👎Deprecated
pub fn next_day(&mut self)
Creates new day with all tasks/sections from most recent day and cleared Done section next_day is idempotent, meaning it will do nothing if today already exists in days
pub fn save(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>
pub fn load(todo_file: &PathBuf) -> Result<Todo, Box<dyn Error + Send + Sync>>
pub fn add( &mut self, task_txt: &str, section: &str, ) -> Result<(), Box<dyn Error + Send + Sync>>
Trait Implementations§
impl StructuralPartialEq for Todo
Auto Trait Implementations§
impl Freeze for Todo
impl RefUnwindSafe for Todo
impl Send for Todo
impl Sync for Todo
impl Unpin for Todo
impl UnwindSafe for Todo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more