[−][src]Struct task_hookrs::task::Task
Task type
A task must have four things:
- A Status
- An UUID
- An Entry-Date
- A Description
all other Data is optional by taskwarrior. This type is a simple rust representation of the JSON exported by taskwarrior.
For further explanations of the fields please consult the documentation on https://taskwarrior.org/
It is deserializeable and serializeable via serde_json, so importing and exporting taskwarrior tasks is simply serializing and deserializing objects of this type.
Methods
impl Task[src]
pub fn new(
id: Option<u64>,
status: TaskStatus,
uuid: Uuid,
entry: Date,
description: String,
annotations: Option<Vec<Annotation>>,
depends: Option<Vec<Uuid>>,
due: Option<Date>,
end: Option<Date>,
imask: Option<f64>,
mask: Option<String>,
modified: Option<Date>,
parent: Option<Uuid>,
priority: Option<TaskPriority>,
project: Option<Project>,
recur: Option<String>,
scheduled: Option<Date>,
start: Option<Date>,
tags: Option<Vec<Tag>>,
until: Option<Date>,
wait: Option<Date>,
uda: UDA
) -> Task[src]
id: Option<u64>,
status: TaskStatus,
uuid: Uuid,
entry: Date,
description: String,
annotations: Option<Vec<Annotation>>,
depends: Option<Vec<Uuid>>,
due: Option<Date>,
end: Option<Date>,
imask: Option<f64>,
mask: Option<String>,
modified: Option<Date>,
parent: Option<Uuid>,
priority: Option<TaskPriority>,
project: Option<Project>,
recur: Option<String>,
scheduled: Option<Date>,
start: Option<Date>,
tags: Option<Vec<Tag>>,
until: Option<Date>,
wait: Option<Date>,
uda: UDA
) -> Task
Create a new Task instance
pub fn id(&self) -> Option<u64>[src]
Get the id of the task
pub fn status(&self) -> &TaskStatus[src]
Get the status of the task
pub fn status_mut(&mut self) -> &mut TaskStatus[src]
Get the status of the task mutable
pub fn uuid(&self) -> &Uuid[src]
Get the uuid of the task
pub fn uuid_mut(&mut self) -> &mut Uuid[src]
Get the uuid of the task mutable
pub fn entry(&self) -> &Date[src]
Get the entry date of the task
pub fn entry_mut(&mut self) -> &mut Date[src]
Get the entry date of the task mutable
pub fn description(&self) -> &String[src]
Get the description of the task
pub fn description_mut(&mut self) -> &mut String[src]
Get the description of the task mutable
pub fn annotations(&self) -> Option<&Vec<Annotation>>[src]
Get the annotations of the task
pub fn annotations_mut(&mut self) -> Option<&mut Vec<Annotation>>[src]
Get the annotations of the task mutable
pub fn set_annotations<T, A>(&mut self, new: Option<T>) where
T: IntoIterator,
T::Item: Into<Annotation>, [src]
T: IntoIterator,
T::Item: Into<Annotation>,
Set annotations
pub fn depends(&self) -> Option<&Vec<Uuid>>[src]
Get the dependencies of the task
pub fn depends_mut(&mut self) -> Option<&mut Vec<Uuid>>[src]
Get the dependencies of the task mutable
pub fn set_depends<T, U>(&mut self, new: Option<T>) where
T: IntoIterator,
T::Item: Into<Uuid>, [src]
T: IntoIterator,
T::Item: Into<Uuid>,
Set depends
pub fn due(&self) -> Option<&Date>[src]
Get the due date of the task
pub fn due_mut(&mut self) -> Option<&mut Date>[src]
Get the due date of the task mutable
pub fn set_due<T>(&mut self, new: Option<T>) where
T: Into<Date>, [src]
T: Into<Date>,
Set due
pub fn end(&self) -> Option<&Date>[src]
Get the end date of the task
pub fn end_mut(&mut self) -> Option<&mut Date>[src]
Get the end date of the task mutable
pub fn set_end<T>(&mut self, new: Option<T>) where
T: Into<Date>, [src]
T: Into<Date>,
Set end
pub fn imask(&self) -> Option<&f64>[src]
Get the imask of the task
pub fn imask_mut(&mut self) -> Option<&mut f64>[src]
Get the imask of the task mutable
pub fn set_imask<T>(&mut self, new: Option<T>) where
T: Into<f64>, [src]
T: Into<f64>,
Set imask
pub fn mask(&self) -> Option<&String>[src]
Get the mask of the task
pub fn mask_mut(&mut self) -> Option<&mut String>[src]
Get the mask of the task mutable
pub fn set_mask<T>(&mut self, new: Option<T>) where
T: Into<String>, [src]
T: Into<String>,
Set mask
pub fn modified(&self) -> Option<&Date>[src]
Get the modified date of the task
pub fn modified_mut(&mut self) -> Option<&mut Date>[src]
Get the modified date of the task mutable
pub fn set_modified<T>(&mut self, new: Option<T>) where
T: Into<Date>, [src]
T: Into<Date>,
Set modified
pub fn parent(&self) -> Option<&Uuid>[src]
Get the parent of the task
pub fn parent_mut(&mut self) -> Option<&mut Uuid>[src]
Get the parent of the task mutable
pub fn set_parent<T>(&mut self, new: Option<T>) where
T: Into<Uuid>, [src]
T: Into<Uuid>,
Set parent
pub fn priority(&self) -> Option<&TaskPriority>[src]
Get the priority of the task
pub fn priority_mut(&mut self) -> Option<&mut TaskPriority>[src]
Get the priority of the task mutable
pub fn set_priority<T>(&mut self, new: Option<T>) where
T: Into<TaskPriority>, [src]
T: Into<TaskPriority>,
Set priority
pub fn project(&self) -> Option<&Project>[src]
Get the project of the task
pub fn project_mut(&mut self) -> Option<&mut Project>[src]
Get the project of the task mutable
pub fn set_project<T>(&mut self, new: Option<T>) where
T: Into<Project>, [src]
T: Into<Project>,
Set project
pub fn recur(&self) -> Option<&String>[src]
Get the recur of the task
This is exported as String by now. This might change in future versions of this crate.
pub fn recur_mut(&mut self) -> Option<&mut String>[src]
This is exported as String by now. This might change in future versions of this crate. mutable
pub fn set_recur<T>(&mut self, new: Option<T>) where
T: Into<String>, [src]
T: Into<String>,
Set recur
pub fn scheduled(&self) -> Option<&Date>[src]
Get the scheduled date of the task
pub fn scheduled_mut(&mut self) -> Option<&mut Date>[src]
Get the scheduled date of the task mutable
pub fn set_scheduled<T>(&mut self, new: Option<T>) where
T: Into<Date>, [src]
T: Into<Date>,
Set scheduled
pub fn start(&self) -> Option<&Date>[src]
Get the start date of the task
pub fn start_mut(&mut self) -> Option<&mut Date>[src]
Get the start date of the task mutable
pub fn set_start<T>(&mut self, new: Option<T>) where
T: Into<Date>, [src]
T: Into<Date>,
Set start
pub fn tags(&self) -> Option<&Vec<Tag>>[src]
Get the tags of the task
pub fn tags_mut(&mut self) -> Option<&mut Vec<Tag>>[src]
Get the tags of the task mutable
pub fn set_tags<T, K>(&mut self, new: Option<T>) where
T: IntoIterator,
T::Item: Into<Tag>, [src]
T: IntoIterator,
T::Item: Into<Tag>,
Set tags
pub fn until(&self) -> Option<&Date>[src]
Get the until date of the task
pub fn until_mut(&mut self) -> Option<&mut Date>[src]
Get the until date of the task mutable
pub fn set_until<T>(&mut self, new: Option<T>) where
T: Into<Date>, [src]
T: Into<Date>,
Set until
pub fn wait(&self) -> Option<&Date>[src]
Get the wait date of the task
pub fn wait_mut(&mut self) -> Option<&mut Date>[src]
Get the wait date of the task mutable
pub fn set_wait<T>(&mut self, new: Option<T>) where
T: Into<Date>, [src]
T: Into<Date>,
Set wait
pub fn uda(&self) -> &UDA[src]
Get the BTreeMap that contains the UDA
pub fn uda_mut(&mut self) -> &mut UDA[src]
Get the BTreeMap that contains the UDA mutable
Trait Implementations
impl Clone for Task[src]
impl PartialEq<Task> for Task[src]
impl Debug for Task[src]
impl StructuralPartialEq for Task[src]
impl Serialize for Task[src]
impl<'de> Deserialize<'de> for Task[src]
fn deserialize<D>(deserializer: D) -> RResult<Task, D::Error> where
D: Deserializer<'de>, [src]
D: Deserializer<'de>,
Auto Trait Implementations
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnwindSafe for Task
impl RefUnwindSafe for Task
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>, [src]
T: Deserialize<'de>,