pub enum TodoStatus {
Pending,
Done,
Cancelled,
}Expand description
Status of a TODO item.
TODOs progress through different states during their lifecycle.
Reopening a completed or cancelled TODO (transition back to Pending) is not allowed;
add a new TODO instead.
Variants§
Pending
TODO is pending and needs to be completed
Done
TODO has been completed
Cancelled
TODO has been cancelled and will not be completed
Implementations§
Source§impl TodoStatus
impl TodoStatus
pub const PENDING: &'static str = "pending"
pub const DONE: &'static str = "done"
pub const CANCELLED: &'static str = "cancelled"
Sourcepub fn can_transition_to(self, target: Self) -> bool
pub fn can_transition_to(self, target: Self) -> bool
Returns whether a transition from self to target is allowed.
Sourcepub fn is_reopen_attempt(from: Self, to: Self) -> bool
pub fn is_reopen_attempt(from: Self, to: Self) -> bool
Returns true when moving a terminal TODO back to pending (reopen).
Sourcepub fn is_terminal(self) -> bool
pub fn is_terminal(self) -> bool
Returns true when the TODO can no longer be worked on.
Trait Implementations§
Source§impl Clone for TodoStatus
impl Clone for TodoStatus
Source§fn clone(&self) -> TodoStatus
fn clone(&self) -> TodoStatus
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TodoStatus
Source§impl Debug for TodoStatus
impl Debug for TodoStatus
impl Eq for TodoStatus
Source§impl FromStr for TodoStatus
impl FromStr for TodoStatus
Source§impl PartialEq for TodoStatus
impl PartialEq for TodoStatus
Source§fn eq(&self, other: &TodoStatus) -> bool
fn eq(&self, other: &TodoStatus) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TodoStatus
impl Serialize for TodoStatus
impl StructuralPartialEq for TodoStatus
Auto Trait Implementations§
impl Freeze for TodoStatus
impl RefUnwindSafe for TodoStatus
impl Send for TodoStatus
impl Sync for TodoStatus
impl Unpin for TodoStatus
impl UnsafeUnpin for TodoStatus
impl UnwindSafe for TodoStatus
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