pub enum AsyncError {
Error(String),
None,
Cancelled,
Timeout,
}Expand description
Represents errors that can occur during asynchronous operations.
This enum provides a standardized way to represent different types of errors that might occur during asynchronous operations, such as general errors, None values, cancellations, and timeouts.
Variants§
Error(String)
A general error with a message describing what went wrong.
None
An operation returned None when a value was expected.
Cancelled
The operation was cancelled before completion.
Timeout
The operation timed out.
Implementations§
Source§impl AsyncError
impl AsyncError
pub fn error(msg: impl Into<String>) -> Self
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Returns true if this error represents a cancelled operation.
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Returns true if this error represents a timeout.
Trait Implementations§
Source§impl Clone for AsyncError
impl Clone for AsyncError
Source§fn clone(&self) -> AsyncError
fn clone(&self) -> AsyncError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AsyncError
impl Debug for AsyncError
Source§impl Display for AsyncError
impl Display for AsyncError
Source§impl Error for AsyncError
impl Error for AsyncError
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()
Source§impl Hash for AsyncError
impl Hash for AsyncError
Source§impl PartialEq for AsyncError
impl PartialEq for AsyncError
impl Eq for AsyncError
impl StructuralPartialEq for AsyncError
Auto Trait Implementations§
impl Freeze for AsyncError
impl RefUnwindSafe for AsyncError
impl Send for AsyncError
impl Sync for AsyncError
impl Unpin for AsyncError
impl UnwindSafe for AsyncError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ExecutionResult<T> for Twhere
T: Clone,
impl<T> ExecutionResult<T> for Twhere
T: Clone,
Source§fn into_async(self) -> Async<T>
fn into_async(self) -> Async<T>
Converts the implementor into an
Async<T> representation. Read more