pub enum RetryAttemptFailure<E> {
Error(E),
AttemptTimeout {
elapsed: Duration,
timeout: Duration,
},
}Expand description
Failure produced by a single attempt.
The generic parameter E is the caller’s original application error type.
Timeout failures do not contain an E value because they are produced by
the retry executor while waiting for an asynchronous attempt.
Variants§
Error(E)
The operation returned an application error.
AttemptTimeout
An async attempt exceeded the timeout passed to
crate::RetryExecutor::run_async_with_timeout.
Implementations§
Source§impl<E> RetryAttemptFailure<E>
impl<E> RetryAttemptFailure<E>
Sourcepub fn as_error(&self) -> Option<&E>
pub fn as_error(&self) -> Option<&E>
Returns the application error when this failure wraps one.
§Parameters
This method has no parameters.
§Returns
Some(&E) for RetryAttemptFailure::Error, or None for
RetryAttemptFailure::AttemptTimeout.
§Errors
This method does not return errors.
Sourcepub fn into_error(self) -> Option<E>
pub fn into_error(self) -> Option<E>
Consumes the failure and returns the application error when present.
§Parameters
This method has no parameters.
§Returns
Some(E) for RetryAttemptFailure::Error, or None for
RetryAttemptFailure::AttemptTimeout.
§Errors
This method does not return errors.
Trait Implementations§
Source§impl<E: Clone> Clone for RetryAttemptFailure<E>
impl<E: Clone> Clone for RetryAttemptFailure<E>
Source§fn clone(&self) -> RetryAttemptFailure<E>
fn clone(&self) -> RetryAttemptFailure<E>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<E: Debug> Debug for RetryAttemptFailure<E>
impl<E: Debug> Debug for RetryAttemptFailure<E>
Source§impl<E> Display for RetryAttemptFailure<E>where
E: Display,
impl<E> Display for RetryAttemptFailure<E>where
E: Display,
Source§impl<E: PartialEq> PartialEq for RetryAttemptFailure<E>
impl<E: PartialEq> PartialEq for RetryAttemptFailure<E>
impl<E: Eq> Eq for RetryAttemptFailure<E>
impl<E> StructuralPartialEq for RetryAttemptFailure<E>
Auto Trait Implementations§
impl<E> Freeze for RetryAttemptFailure<E>where
E: Freeze,
impl<E> RefUnwindSafe for RetryAttemptFailure<E>where
E: RefUnwindSafe,
impl<E> Send for RetryAttemptFailure<E>where
E: Send,
impl<E> Sync for RetryAttemptFailure<E>where
E: Sync,
impl<E> Unpin for RetryAttemptFailure<E>where
E: Unpin,
impl<E> UnsafeUnpin for RetryAttemptFailure<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for RetryAttemptFailure<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.