pub enum AttemptFailure<E> {
Error(E),
Timeout,
Panic(AttemptPanic),
Executor(AttemptExecutorError),
}Expand description
Failure produced by a single operation attempt.
The generic parameter E is the caller’s operation error type. Timeout,
panic, and executor failures do not contain E because they are generated
by the retry runtime, not returned by the operation.
Variants§
Error(E)
The operation returned an application error.
Timeout
The attempt exceeded the effective timeout.
This can be the configured per-attempt timeout, the remaining max-operation-elapsed budget, or the remaining max-total-elapsed budget used by async and worker-thread attempts.
Panic(AttemptPanic)
The attempt panicked inside an isolated execution boundary.
Executor(AttemptExecutorError)
The retry executor failed before the attempt could run normally.
Implementations§
Source§impl<E> AttemptFailure<E>
impl<E> AttemptFailure<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 AttemptFailure::Error, or None for
runtime-generated failures.
§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 AttemptFailure::Error, or None for
runtime-generated failures.
§Errors
This method does not return errors.
Sourcepub fn as_panic(&self) -> Option<&AttemptPanic>
pub fn as_panic(&self) -> Option<&AttemptPanic>
Returns captured panic information when this failure wraps one.
§Parameters
This method has no parameters.
§Returns
Some(&AttemptPanic) for AttemptFailure::Panic, or None for other
variants.
§Errors
This method does not return errors.
Sourcepub fn as_executor_error(&self) -> Option<&AttemptExecutorError>
pub fn as_executor_error(&self) -> Option<&AttemptExecutorError>
Returns executor failure information when this failure wraps one.
§Parameters
This method has no parameters.
§Returns
Some(&AttemptExecutorError) for AttemptFailure::Executor, or
None for other variants.
§Errors
This method does not return errors.
Trait Implementations§
Source§impl<E: Clone> Clone for AttemptFailure<E>
impl<E: Clone> Clone for AttemptFailure<E>
Source§fn clone(&self) -> AttemptFailure<E>
fn clone(&self) -> AttemptFailure<E>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<E: Debug> Debug for AttemptFailure<E>
impl<E: Debug> Debug for AttemptFailure<E>
Source§impl<'de, E> Deserialize<'de> for AttemptFailure<E>where
E: DeserializeOwned,
impl<'de, E> Deserialize<'de> for AttemptFailure<E>where
E: DeserializeOwned,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<E: Display> Display for AttemptFailure<E>
impl<E: Display> Display for AttemptFailure<E>
Source§impl<E: PartialEq> PartialEq for AttemptFailure<E>
impl<E: PartialEq> PartialEq for AttemptFailure<E>
Source§fn eq(&self, other: &AttemptFailure<E>) -> bool
fn eq(&self, other: &AttemptFailure<E>) -> bool
self and other values to be equal, and is used by ==.Source§impl<E> Serialize for AttemptFailure<E>where
E: Serialize,
impl<E> Serialize for AttemptFailure<E>where
E: Serialize,
impl<E: Eq> Eq for AttemptFailure<E>
impl<E> StructuralPartialEq for AttemptFailure<E>
Auto Trait Implementations§
impl<E> Freeze for AttemptFailure<E>where
E: Freeze,
impl<E> RefUnwindSafe for AttemptFailure<E>where
E: RefUnwindSafe,
impl<E> Send for AttemptFailure<E>where
E: Send,
impl<E> Sync for AttemptFailure<E>where
E: Sync,
impl<E> Unpin for AttemptFailure<E>where
E: Unpin,
impl<E> UnsafeUnpin for AttemptFailure<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for AttemptFailure<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.Source§impl<T, D> IntoConfigDefault<T> for Dwhere
D: IntoValueDefault<T>,
impl<T, D> IntoConfigDefault<T> for Dwhere
D: IntoValueDefault<T>,
Source§fn into_config_default(self) -> T
fn into_config_default(self) -> T
T.