pub enum Error<E> {
MaybeRetryable(E),
Fatal(E),
TimedOut(TimeoutError<E>),
}Expand description
Error type for EaseOff which includes the fatality level of the error.
Variants§
MaybeRetryable(E)
The inner error has not been determined to be fatal yet.
RetryableError::can_retry() passes through to the inner error.
Fatal(E)
The error was determined to be fatal.
Always returns false from RetryableError::can_retry().
TimedOut(TimeoutError<E>)
The deadline has elapsed.
Contained is the error from the most recent attempt.
Always returns false from RetryableError::can_retry().
Implementations§
Source§impl<E> Error<E>
impl<E> Error<E>
Sourcepub fn on_timeout(
self,
on_timeout: impl FnOnce(TimeoutError<E>) -> Self,
) -> Self
pub fn on_timeout( self, on_timeout: impl FnOnce(TimeoutError<E>) -> Self, ) -> Self
Convert Error::TimedOut, if applicable, to another variant.
Sourcepub fn map<E2>(self, map: impl FnOnce(E) -> E2) -> Error<E2>
pub fn map<E2>(self, map: impl FnOnce(E) -> E2) -> Error<E2>
Map the inner error type, retaining its retryability status.
Sourcepub fn into_inner(self) -> E
pub fn into_inner(self) -> E
Unwrap the inner error.
Trait Implementations§
Source§impl<E: RetryableError> RetryableError for Error<E>
impl<E: RetryableError> RetryableError for Error<E>
Auto Trait Implementations§
impl<E> Freeze for Error<E>where
E: Freeze,
impl<E> RefUnwindSafe for Error<E>where
E: RefUnwindSafe,
impl<E> Send for Error<E>where
E: Send,
impl<E> Sync for Error<E>where
E: Sync,
impl<E> Unpin for Error<E>where
E: Unpin,
impl<E> UnsafeUnpin for Error<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for Error<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