#[non_exhaustive]pub enum TaskPhase {
Pending,
Running,
Succeeded,
Failed,
Timeout,
Canceled,
Exhausted,
}Expand description
Current execution phase of a single task attempt.
Phases describe the state of the current attempt.
§Also
TaskStatuscarries the current phase.TaskPhase::is_terminalchecks for final states.RestartPolicygoverns what happens after a terminal phase.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Pending
Task is queued or waiting to start.
Running
Task is currently executing.
Succeeded
Task completed successfully.
Failed
Attempt failed with an error.
Timeout
Task exceeded its timeout limit.
Canceled
Task was explicitly canceled.
Exhausted
Task exhausted its restart budget and will not retry.
Implementations§
Source§impl TaskPhase
impl TaskPhase
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Returns true if the current attempt has reached a final state.
A terminal phase means this attempt will not transition further.
The supervisor may still start a new attempt based on the RestartPolicy.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskPhase
impl<'de> Deserialize<'de> for TaskPhase
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
Source§impl FromStr for TaskPhase
impl FromStr for TaskPhase
Source§fn from_str(s: &str) -> ModelResult<Self>
fn from_str(s: &str) -> ModelResult<Self>
Parse a phase name (case-insensitive, trimmed). Accepts the same
camelCase form produced by fmt::Display / serde.
Source§type Err = ModelError
type Err = ModelError
The associated error which can be returned from parsing.
impl Copy for TaskPhase
impl Eq for TaskPhase
impl StructuralPartialEq for TaskPhase
Auto Trait Implementations§
impl Freeze for TaskPhase
impl RefUnwindSafe for TaskPhase
impl Send for TaskPhase
impl Sync for TaskPhase
impl Unpin for TaskPhase
impl UnsafeUnpin for TaskPhase
impl UnwindSafe for TaskPhase
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