pub struct AsyncError<E: Error + 'static> { /* private fields */ }Expand description
Wraps an error with optional context.
Implementations§
Source§impl<E: Error + 'static> AsyncError<E>
impl<E: Error + 'static> AsyncError<E>
Sourcepub fn with_context(self, context: String) -> Self
pub fn with_context(self, context: String) -> Self
Adds context to the error.
If the hooks feature is enabled, hooks may be triggered.
Sourcepub fn inner_error(&self) -> &E
pub fn inner_error(&self) -> &E
Returns a reference to the inner error.
Sourcepub fn invoke_hooks_once(&self) -> bool
pub fn invoke_hooks_once(&self) -> bool
Returns true if hooks have not been invoked yet, and marks them as invoked.
Trait Implementations§
Source§impl<E: Error + 'static> Display for AsyncError<E>
impl<E: Error + 'static> Display for AsyncError<E>
Source§impl<E: Error + 'static> Error for AsyncError<E>
impl<E: Error + 'static> Error for AsyncError<E>
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 AsyncError<E>
impl<E> RefUnwindSafe for AsyncError<E>where
E: RefUnwindSafe,
impl<E> Send for AsyncError<E>where
E: Send,
impl<E> Sync for AsyncError<E>where
E: Sync,
impl<E> Unpin for AsyncError<E>where
E: Unpin,
impl<E> UnsafeUnpin for AsyncError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for AsyncError<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