#[non_exhaustive]pub enum TaskPhase {
Pending,
Running,
Succeeded,
Failed,
Timeout,
Canceled,
Exhausted,
}Expand description
Current execution phase of a task.
Phases describe the state visible on TaskStatus.
§Example
use solti_model::TaskPhase;
let phase: TaskPhase = "running".parse().unwrap();
assert!(phase.is_active());
assert_eq!(phase.to_string(), "running");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
Desired state is waiting for execution.
Running
An attempt is executing.
Succeeded
An attempt completed successfully.
Failed
Attempt failed with an error.
Timeout
An attempt exceeded its timeout.
Canceled
Execution was canceled.
Exhausted
Failure retry budget was exhausted.
Implementations§
Source§impl TaskPhase
impl TaskPhase
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Returns whether the phase is terminal.
A later attempt may still start under RestartPolicy.
Resource reconciliation may also refine or replace a terminal outcome.
§Example
use solti_model::TaskPhase;
assert!(TaskPhase::Succeeded.is_terminal());
assert!(!TaskPhase::Running.is_terminal());Trait Implementations§
impl Copy for TaskPhase
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
impl Eq for TaskPhase
Source§impl FromStr for TaskPhase
impl FromStr for TaskPhase
Source§fn from_str(s: &str) -> ModelResult<Self>
fn from_str(s: &str) -> ModelResult<Self>
Parses a phase name.
Parsing trims whitespace and ignores ASCII case.
§Errors
Returns ModelError::UnknownTaskPhase for an unknown value.
Source§type Err = ModelError
type Err = ModelError
The associated error which can be returned from parsing.
Source§impl JsonSchema for TaskPhase
impl JsonSchema for TaskPhase
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl 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