pub enum TaskFailureKind {
CommandFailed,
ParseFailed,
ValidationFailed,
Timeout,
DependencyFailed,
Unknown,
}Expand description
Classifies the type of failure that occurred during a task execution attempt.
This enum categorizes task execution failures into distinct types, allowing for more targeted error handling, retry logic, and diagnostic reporting. Each variant represents a different category of task failure that may require different handling strategies.
§Variants
-
CommandFailed- The command or operation executed by the task failed. This typically indicates that the command returned a non-zero exit code or encountered an error during execution. -
ParseFailed- Parsing of the task output or result failed. This indicates that the task executed successfully but the output could not be parsed into the expected format or structure. -
ValidationFailed- Validation of the task result or output failed. This indicates that the task executed and was parsed successfully, but the result did not meet the expected validation criteria. -
Timeout- The task execution exceeded the configured timeout period. This typically indicates that the task took too long to complete or became unresponsive. -
DependencyFailed- A dependency required by the task failed or was not available. This indicates that the task could not execute because a prerequisite task or resource was not in the expected state. -
Unknown- The failure type could not be determined or does not fit into any of the other categories. This is used as a fallback for unexpected or unclassified errors.
§Examples
// Create different failure kinds
let command_failed = TaskFailureKind::CommandFailed;
let parse_failed = TaskFailureKind::ParseFailed;
let timeout = TaskFailureKind::Timeout;
// Use in task status
let failed_status = TaskStatus::Failed(TaskFailureKind::ParseFailed);
assert!(matches!(failed_status, TaskStatus::Failed(_)));Variants§
Trait Implementations§
Source§impl Clone for TaskFailureKind
impl Clone for TaskFailureKind
Source§fn clone(&self) -> TaskFailureKind
fn clone(&self) -> TaskFailureKind
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 TaskFailureKind
impl Debug for TaskFailureKind
impl Eq for TaskFailureKind
Source§impl PartialEq for TaskFailureKind
impl PartialEq for TaskFailureKind
Source§fn eq(&self, other: &TaskFailureKind) -> bool
fn eq(&self, other: &TaskFailureKind) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TaskFailureKind
Auto Trait Implementations§
impl Freeze for TaskFailureKind
impl RefUnwindSafe for TaskFailureKind
impl Send for TaskFailureKind
impl Sync for TaskFailureKind
impl Unpin for TaskFailureKind
impl UnsafeUnpin for TaskFailureKind
impl UnwindSafe for TaskFailureKind
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.