pub struct ToDo {
pub tasks: Vec<Task>,
}
Fields§
§tasks: Vec<Task>
Implementations§
Source§impl ToDo
impl ToDo
Sourcepub fn get_to_do(file_path: &Utf8Path) -> Result<Self, TaskerFailure>
pub fn get_to_do(file_path: &Utf8Path) -> Result<Self, TaskerFailure>
Parses and returns a deserialized ToDo
struct from the given file path.
§Errors
Returns an error if the program failed to read the given file.
Sourcepub fn get_default_to_do_path() -> Result<Utf8PathBuf, TaskerFailure>
pub fn get_default_to_do_path() -> Result<Utf8PathBuf, TaskerFailure>
Returns the default path to store Tasks in.
§Errors
Returns an error if it failed to determine the default file paths for the program or if this path is not valid UTF-8.
Sourcepub fn save(&self, path: &Utf8Path) -> Result<(), TaskerFailure>
pub fn save(&self, path: &Utf8Path) -> Result<(), TaskerFailure>
Writes the Tassk into the filesystem.
§Errors
Returns an error if it failed to create the file at the given location,
if it failed to serialize the ToDo
struct into the RON file format or
if it failed to write data into the given file path.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToDo
impl<'de> Deserialize<'de> for ToDo
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
impl Eq for ToDo
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.