pub enum TaskState {
Pending,
Running {
start_time: DateTime<Utc>,
},
Completed {
completion_time: DateTime<Utc>,
},
Failed {
error: String,
failure_time: DateTime<Utc>,
},
Skipped {
reason: String,
skip_time: DateTime<Utc>,
},
}Expand description
Represents the execution state of a task throughout its lifecycle.
Tasks progress through these states during execution, providing visibility into the current status and enabling proper error handling and recovery.
§State Transitions
Pending->Running: When task execution beginsRunning->Completed: When task completes successfullyRunning->Failed: When task encounters an errorFailed->Running: When task is retried
Terminal states (Completed and Failed) do not transition to other states
unless a retry is attempted.
Variants§
Pending
Task is registered but not yet started
Running
Task is currently executing
Completed
Task finished successfully
Failed
Task encountered an error
Skipped
Task was skipped (e.g., trigger rule not satisfied)
Implementations§
Source§impl TaskState
impl TaskState
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Returns true if the task is in the completed state
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Returns true if the task is currently running
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Returns true if the task is pending execution
Sourcepub fn is_skipped(&self) -> bool
pub fn is_skipped(&self) -> bool
Returns true if the task was skipped
Trait Implementations§
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>,
Deserialize this value from the given Serde deserializer. Read more
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 UnwindSafe for TaskState
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)