pub enum TaskStatus {
Pending,
Running,
Succeeded,
RetryPending,
Failed(TaskFailureKind),
Skipped,
}Expand description
Represents the current status of a task execution attempt for a host/task pair.
This enum tracks the lifecycle of a task execution, from the initial pending state
through various stages of execution, including success, retry, and failure states.
It is used within TaskAttemptState to provide high-level information about the
current state of a task execution.
§Variants
-
Pending- The task has been scheduled but has not yet started execution. This is the initial state before any task execution activity begins. -
Running- The task is currently being executed. This state indicates that the task execution is actively in progress. -
Succeeded- The task has completed successfully. This state indicates that the task execution finished without errors and achieved its intended outcome. -
RetryPending- A task execution attempt has failed but will be retried. This state indicates that the task will be attempted again after a delay or under different conditions. -
Failed(TaskFailureKind)- The task execution has failed and will not be retried. This state includes aTaskFailureKindthat classifies the type of failure that occurred (e.g., command failed, parse failed, validation failed, timeout). -
Skipped- The task was skipped and not executed. This typically occurs when task conditions are not met or when the task is explicitly configured to be skipped.
§Examples
// Check different task states
let pending = TaskStatus::Pending;
let running = TaskStatus::Running;
let succeeded = TaskStatus::Succeeded;
let failed = TaskStatus::Failed(TaskFailureKind::ParseFailed);
assert_eq!(pending, TaskStatus::Pending);
assert_eq!(running, TaskStatus::Running);
assert_eq!(succeeded, TaskStatus::Succeeded);
assert!(matches!(failed, TaskStatus::Failed(_)));Variants§
Trait Implementations§
Source§impl Clone for TaskStatus
impl Clone for TaskStatus
Source§fn clone(&self) -> TaskStatus
fn clone(&self) -> TaskStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TaskStatus
impl Debug for TaskStatus
impl Eq for TaskStatus
Source§impl PartialEq for TaskStatus
impl PartialEq for TaskStatus
Source§fn eq(&self, other: &TaskStatus) -> bool
fn eq(&self, other: &TaskStatus) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TaskStatus
Auto Trait Implementations§
impl Freeze for TaskStatus
impl RefUnwindSafe for TaskStatus
impl Send for TaskStatus
impl Sync for TaskStatus
impl Unpin for TaskStatus
impl UnsafeUnpin for TaskStatus
impl UnwindSafe for TaskStatus
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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§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.