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: Stringpriority: u8finished: boolcontexts: Vec<String>projects: Vec<String>tags: HashMap<String, String>create_date: Option<NaiveDate>finish_date: Option<NaiveDate>due_date: Option<NaiveDate>threshold_date: Option<NaiveDate>recurrence: Option<Recurrence>

Implementations

Coverts a string to a task.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.