pub struct Parts<Context, IdType = RandomId> {
pub task_id: Option<TaskId<IdType>>,
pub data: Extensions,
pub attempt: Attempt,
pub ctx: Context,
pub status: AtomicStatus,
pub run_at: u64,
pub queue: Option<Queue>,
}Expand description
Component parts of a Task
Fields§
§task_id: Option<TaskId<IdType>>The task’s id if allocated
data: ExtensionsThe tasks’s extensions
attempt: AttemptThe tasks’s attempts Keeps track of the number of attempts a task has been worked on
ctx: ContextThe task specific data provided by the backend
status: AtomicStatusThe task status that is wrapped in an atomic status
run_at: u64The time a task should be run
queue: Option<Queue>The queue the task belongs to This is a runtime only field and is not serialized It is set by the backend when the task is fetched from the queue Workers can use this to determine which queue they are processing tasks from Sinks can also use this to determine which queue to send the task to This field is optional as not all backends support queues For example, a simple in-memory backend does not have the concept of queues
Trait Implementations§
Source§impl<'de, Context, IdType> Deserialize<'de> for Parts<Context, IdType>where
Context: Deserialize<'de>,
IdType: Deserialize<'de>,
impl<'de, Context, IdType> Deserialize<'de> for Parts<Context, IdType>where
Context: Deserialize<'de>,
IdType: Deserialize<'de>,
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<Context, IdType> Freeze for Parts<Context, IdType>
impl<Context, IdType = RandomId> !RefUnwindSafe for Parts<Context, IdType>
impl<Context, IdType> Send for Parts<Context, IdType>
impl<Context, IdType> Sync for Parts<Context, IdType>
impl<Context, IdType> Unpin for Parts<Context, IdType>
impl<Context, IdType = RandomId> !UnwindSafe for Parts<Context, IdType>
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