pub struct TaskData { /* private fields */ }Expand description
A task.
This type presents a low-level interface consisting only of a key/value map. Interpretation of
fields is up to the user, and modifications both modify the TaskData and create one or
more Operation values that can later be committed to the replica.
This interface is intended for sophisticated applications like Taskwarrior which give meaning
to key and values themselves. Use Task for a higher-level interface with
methods to update status, set tags, and so on.
Implementations§
Source§impl TaskData
impl TaskData
Sourcepub fn create(uuid: Uuid, operations: &mut Operations) -> Self
pub fn create(uuid: Uuid, operations: &mut Operations) -> Self
Create a new, empty task with the given UUID.
Sourcepub fn properties(&self) -> impl Iterator<Item = &String>
pub fn properties(&self) -> impl Iterator<Item = &String>
Enumerate all properties on this task, in arbitrary order.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&String, &String)>
pub fn iter(&self) -> impl Iterator<Item = (&String, &String)>
Enumerate all properties and their values on this task, in arbitrary order.
Sourcepub fn update(
&mut self,
property: impl Into<String>,
value: Option<String>,
operations: &mut Operations,
)
pub fn update( &mut self, property: impl Into<String>, value: Option<String>, operations: &mut Operations, )
Set or remove a value on this task, adding an Update operation to the set of operations.
Setting a value to None removes that value from the task.
This method does not have any special handling of the modified property.
Sourcepub fn delete(&mut self, operations: &mut Operations)
pub fn delete(&mut self, operations: &mut Operations)
Delete this task.
Note that this is different from setting status to Deleted:
the resulting operation removes the task from the database.
Deletion may interact poorly with modifications to the same task on other replicas. For
example, if a task is deleted on replica 1 and its description modified on replica 2, then
after both replicas have fully synced, the resulting task will only have a description
property.
After this call, the TaskData value still exists but has no properties and should be
dropped.
Trait Implementations§
impl Eq for TaskData
impl StructuralPartialEq for TaskData
Auto Trait Implementations§
impl Freeze for TaskData
impl RefUnwindSafe for TaskData
impl Send for TaskData
impl Sync for TaskData
impl Unpin for TaskData
impl UnwindSafe for TaskData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more