pub enum TaskExecutionError<E> {
Failed(E),
Panicked,
Cancelled,
}Expand description
Error observed when retrieving the result of an accepted task.
This error is distinct from RejectedExecution.
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 cancelled before producing a result.
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 cancelled.
§Returns
true if the task was cancelled before producing a 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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl<E> Freeze for TaskExecutionError<E>where
E: Freeze,
impl<E> RefUnwindSafe for TaskExecutionError<E>where
E: RefUnwindSafe,
impl<E> Send for TaskExecutionError<E>where
E: Send,
impl<E> Sync for TaskExecutionError<E>where
E: Sync,
impl<E> Unpin for TaskExecutionError<E>where
E: Unpin,
impl<E> UnsafeUnpin for TaskExecutionError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for TaskExecutionError<E>where
E: UnwindSafe,
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