pub struct TaskSpec {
pub task_id: Uuid,
pub description: String,
pub payload: Value,
pub priority: TaskPriority,
pub deadline: Option<DateTime<Utc>>,
}Expand description
Specification for a delegated task.
Fields§
§task_id: UuidUnique task identifier.
description: StringHuman-readable description of the task.
payload: ValueStructured task payload.
priority: TaskPriorityPriority level.
deadline: Option<DateTime<Utc>>Deadline for task completion, if any.
Implementations§
Source§impl TaskSpec
impl TaskSpec
Sourcepub fn new(description: impl Into<String>, payload: Value) -> Self
pub fn new(description: impl Into<String>, payload: Value) -> Self
Creates a new task specification.
Sourcepub fn with_priority(self, priority: TaskPriority) -> Self
pub fn with_priority(self, priority: TaskPriority) -> Self
Sets the priority.
Sourcepub fn with_deadline(self, deadline: DateTime<Utc>) -> Self
pub fn with_deadline(self, deadline: DateTime<Utc>) -> Self
Sets the deadline.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskSpec
impl<'de> Deserialize<'de> for TaskSpec
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
Auto Trait Implementations§
impl Freeze for TaskSpec
impl RefUnwindSafe for TaskSpec
impl Send for TaskSpec
impl Sync for TaskSpec
impl Unpin for TaskSpec
impl UnsafeUnpin for TaskSpec
impl UnwindSafe for TaskSpec
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