pub enum TaskExecutionError<E> {
Failed(E),
Panicked,
Cancelled,
Dropped,
}Expand description
Error observed when retrieving the result of an accepted task.
This error is distinct from SubmissionError.
Rejection happens before a service accepts a task; TaskExecutionError
describes what happened after the task was accepted.
§Type Parameters
E- The error type returned by the task itself.
Variants§
Failed(E)
The task ran and returned Err(E).
Panicked
The task panicked while running.
Cancelled
The task was explicitly cancelled before producing a result.
This includes caller-side cancellation through tracked handles and executor/service-side cancellation of queued, scheduled, or otherwise unstarted work.
Dropped
The accepted runner-side completion endpoint was abandoned without publishing an explicit terminal result.
This represents runner loss or misuse. Services that intentionally stop
unstarted accepted work should publish Self::Cancelled instead.
Implementations§
Source§impl<E> TaskExecutionError<E>
impl<E> TaskExecutionError<E>
Sourcepub const fn is_failed(&self) -> bool
pub const fn is_failed(&self) -> bool
Returns true when this error wraps the task’s own error value.
§Returns
true if the task returned Err(E).
Sourcepub const fn is_panicked(&self) -> bool
pub const fn is_panicked(&self) -> bool
Sourcepub const fn is_cancelled(&self) -> bool
pub const fn is_cancelled(&self) -> bool
Returns true when the task was explicitly cancelled.
§Returns
true if the task was cancelled before producing a result.
Sourcepub const fn is_dropped(&self) -> bool
pub const fn is_dropped(&self) -> bool
Returns true when the task result was abandoned by the completion endpoint.
§Returns
true if the accepted runner-side completion endpoint disappeared
without publishing an explicit terminal result.
Trait Implementations§
Source§impl<E: Debug> Debug for TaskExecutionError<E>
impl<E: Debug> Debug for TaskExecutionError<E>
Source§impl<E> Display for TaskExecutionError<E>where
E: Display,
impl<E> Display for TaskExecutionError<E>where
E: Display,
Source§impl<E> Error for TaskExecutionError<E>where
E: Error + 'static,
impl<E> Error for TaskExecutionError<E>where
E: Error + 'static,
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()