Struct todo_lib::todotxt::Task [−][src]
pub struct Task {
pub subject: String,
pub priority: u8,
pub finished: bool,
pub contexts: Vec<String>,
pub projects: Vec<String>,
pub tags: HashMap<String, String>,
pub create_date: Option<NaiveDate>,
pub finish_date: Option<NaiveDate>,
pub due_date: Option<NaiveDate>,
pub threshold_date: Option<NaiveDate>,
pub recurrence: Option<Recurrence>,
}
Fields
subject: String
priority: u8
finished: bool
contexts: Vec<String>
projects: Vec<String>
create_date: Option<NaiveDate>
finish_date: Option<NaiveDate>
due_date: Option<NaiveDate>
threshold_date: Option<NaiveDate>
recurrence: Option<Recurrence>
Implementations
Replaces the tag value with a new one. If new value is empty, the tag is removed. If the tag does not exist, the function adds it to the task. Tag must be in format “name:value” or “name:”(for removing the tag). Returns true if the tag was updated.
Replaces the tag value with a new one. If new value is empty, the tag is removed. If the tag does not exist, the function adds it to the task. Returns true if the tag was updated.
Mark the task completed. Returns true if the task was changed(e.g., for a completed task the function return false).
If the task has both recurrence and due or threshold date, the recurrence and due dates change so they point to some day in the future. The new values depends on recurrence strictness: for strict recurrence, the new date is always due+recurrence; for regular recurrence, the new due date is current date + recurrence. If the task has only recurrence, the task is not changed. The function does nothing if the task is already completed. Returns true if the task was changed(e.g., for a completed task the function return false).
Remove completion mark from the task. Returns true if the task was changed(e.g., for a incomplete task the function return false).
Replace existing project with a new one. Special cases:
- new is empty: the old project is removed from the task
- old is empty: the new project is appended to the task
Replace existing context with a new one. Special cases:
- new is empty: the old context is removed from the task
- old is empty: the new context is appended to the task
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Task
impl UnwindSafe for Task
Blanket Implementations
Mutably borrows from an owned value. Read more