pub enum TaskError {
Disconnected,
Timeout,
Panicked,
}Expand description
Errors that can occur when working with tasks in the runtime
These represent the various failure modes that can occur when scheduling, executing, or awaiting tasks.
Variants§
Disconnected
The channel used to communicate with a task has been disconnected
This typically occurs when a task or its handle is dropped before the task completes.
Timeout
A timeout occurred while waiting for a task to complete
This can happen when using timeouts with task execution or when the runtime’s block_on method times out.
Panicked
The task panicked during execution
This error is produced when a task panics during its execution. The runtime attempts to capture and propagate this error safely.
Trait Implementations§
Source§impl Error for TaskError
Available on crate feature std only.
impl Error for TaskError
Available on crate feature
std only.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 Freeze for TaskError
impl RefUnwindSafe for TaskError
impl Send for TaskError
impl Sync for TaskError
impl Unpin for TaskError
impl UnwindSafe for TaskError
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