pub enum TaskState {
Pending,
Ready,
Running,
Completed,
Failed,
Retrying,
Cancelled,
Skipped,
DeadLettered,
}Expand description
The lifecycle state of a single task.
Variants§
Pending
Registered but dependencies not yet satisfied.
Ready
All dependencies satisfied; eligible to be scheduled.
Running
Currently executing on a worker.
Completed
Finished successfully.
Failed
Finished with an error (retries exhausted).
Retrying
Failed but scheduled for another attempt.
Cancelled
Cancelled (e.g. graceful shutdown).
Skipped
Skipped because an upstream dependency failed.
DeadLettered
Failed terminally and routed to the dead-letter queue.
Implementations§
Source§impl TaskState
impl TaskState
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Whether the task has reached a state from which it will not progress.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Whether this state counts as a successful completion.
Sourcepub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
Whether this state counts as a failure outcome.
Sourcepub fn can_transition_to(&self, next: TaskState) -> bool
pub fn can_transition_to(&self, next: TaskState) -> bool
Whether a transition to next is permitted by the state machine.
This is the single source of truth for legal lifecycle transitions and
is enforced by crate::state::StateValidator.
Trait Implementations§
impl Copy for TaskState
Source§impl<'de> Deserialize<'de> for TaskState
impl<'de> Deserialize<'de> for TaskState
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>,
impl Eq for TaskState
impl StructuralPartialEq for TaskState
Auto Trait Implementations§
impl Freeze for TaskState
impl RefUnwindSafe for TaskState
impl Send for TaskState
impl Sync for TaskState
impl Unpin for TaskState
impl UnsafeUnpin for TaskState
impl UnwindSafe for TaskState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.