pub struct Task {
pub id: Uuid,
pub task_type: String,
pub payload: Value,
pub metadata: TaskMetadata,
}Expand description
A unit of work dispatched to a worker.
Fields§
§id: Uuid§task_type: String§payload: Value§metadata: TaskMetadataImplementations§
Source§impl Task
impl Task
pub fn new(task_type: impl Into<String>, payload: Value) -> Self
pub fn with_timeout(self, timeout_ms: u64) -> Self
pub fn with_priority(self, priority: Priority) -> Self
pub fn with_max_retries(self, max_retries: u32) -> Self
pub fn with_trace_id(self, trace_id: impl Into<String>) -> Self
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
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