pub struct Task { /* private fields */ }
Expand description
A task the user wants or needs to do.
Implementations§
Source§impl Task
impl Task
Sourcepub fn new(status: TaskStatus, content: &str) -> Task
pub fn new(status: TaskStatus, content: &str) -> Task
Create a new task with the specified status and content.
Sourcepub fn from_string(s: &str) -> Option<Task>
pub fn from_string(s: &str) -> Option<Task>
Parse a task from its string representation.
A task string always begins with one of four characters:
“*” means ToDo
, “^” means Started
, “+” means Completed
,
and “-” means Blocked
. The rest of the string, except for trailing whitespace,
is the content of the task. Returns None
if the string is not a valid task.
Sourcepub fn status(&self) -> TaskStatus
pub fn status(&self) -> TaskStatus
Returns the status of the task.
Trait Implementations§
impl Eq for Task
impl StructuralPartialEq for Task
Auto Trait Implementations§
impl Freeze for Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnwindSafe for Task
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