pub struct Task {
pub id: TaskId,
pub title: String,
pub completed: bool,
pub created_at: DateTime<Utc>,
pub completed_at: Option<DateTime<Utc>>,
}Expand description
Represents a task within a ticket
Tasks are smaller units of work that can be tracked independently within a ticket.
Fields§
§id: TaskIdUnique identifier for the task
title: StringTitle describing what needs to be done
completed: boolWhether the task has been completed
created_at: DateTime<Utc>Timestamp when the task was created
completed_at: Option<DateTime<Utc>>Timestamp when the task was completed
Implementations§
Source§impl Task
impl Task
Sourcepub fn with_id(id: TaskId, title: impl Into<String>) -> Self
pub fn with_id(id: TaskId, title: impl Into<String>) -> Self
Creates a new task with a specific ID (useful for deserialization)
Sourcepub const fn uncomplete(&mut self)
pub const fn uncomplete(&mut self)
Marks the task as incomplete
Sourcepub fn completion_duration(&self) -> Option<Duration>
pub fn completion_duration(&self) -> Option<Duration>
Returns the duration the task took to complete
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Task
impl<'de> Deserialize<'de> for Task
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Task
impl StructuralPartialEq for Task
Auto Trait Implementations§
impl Freeze for Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnsafeUnpin for Task
impl UnwindSafe for Task
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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§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
Compare self to
key and return true if they are equal.