pub struct ExecutionContext { /* private fields */ }Expand description
Execution context of a Task
Implementations§
Source§impl ExecutionContext
impl ExecutionContext
Sourcepub fn data(&self) -> &Extensions
pub fn data(&self) -> &Extensions
Returns the extensions associated with the task.
Sourcepub fn raw_attempt(&self) -> &Attempt
pub fn raw_attempt(&self) -> &Attempt
Get the atomic attempt
Sourcepub fn raw_status(&self) -> &AtomicStatus
pub fn raw_status(&self) -> &AtomicStatus
Get the atomic status
Sourcepub fn run_at(&self) -> Option<u64>
pub fn run_at(&self) -> Option<u64>
Returns the time at which the task is scheduled to run.
Returns None if no run time has been specified.
Sourcepub fn done_at(&self) -> Option<u64>
pub fn done_at(&self) -> Option<u64>
Returns the time at which the task was completed.
Returns None if the task has not been completed.
Sourcepub fn lock_at(&self) -> Option<u64>
pub fn lock_at(&self) -> Option<u64>
Returns the time at which the task was locked.
Returns None if the task is not locked.
Sourcepub fn lock_by(&self) -> Option<&str>
pub fn lock_by(&self) -> Option<&str>
Returns the identifier of the worker or process currently holding the lock on this task.
Returns None if the task is not currently locked.
Sourcepub fn idempotency_key(&self) -> Option<&str>
pub fn idempotency_key(&self) -> Option<&str>
Returns the idempotency key associated with the task.
Returns None if no idempotency key has been specified.
Sourcepub fn metadata(&self) -> &MetadataStore
pub fn metadata(&self) -> &MetadataStore
Returns the metadata associated with the task.
Sourcepub fn max_attempts(&self) -> Option<usize>
pub fn max_attempts(&self) -> Option<usize>
Returns the maximum number of attempts allowed for the task.
Returns None if no maximum has been specified.
Sourcepub fn priority(&self) -> Option<usize>
pub fn priority(&self) -> Option<usize>
Returns the priority of the task.
Returns None if no priority has been specified.
Trait Implementations§
Source§impl Clone for ExecutionContext
impl Clone for ExecutionContext
Source§impl Debug for ExecutionContext
impl Debug for ExecutionContext
Source§impl Default for ExecutionContext
impl Default for ExecutionContext
Source§impl<'de> Deserialize<'de> for ExecutionContext
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ExecutionContext
serde only.