pub struct RetryError<E> { /* private fields */ }Expand description
Error returned when a retry flow terminates without a successful result.
The generic parameter E is the caller’s application error type. It is
preserved in AttemptFailure::Error when the terminal failure came from
the user operation. Runtime failures such as timeout, panic, and executor
failures are preserved through RetryError::last_failure.
Implementations§
Source§impl<E> RetryError<E>
impl<E> RetryError<E>
Sourcepub fn reason(&self) -> RetryErrorReason
pub fn reason(&self) -> RetryErrorReason
Sourcepub fn context(&self) -> &RetryContext
pub fn context(&self) -> &RetryContext
Sourcepub fn attempt_timeout_source(&self) -> Option<AttemptTimeoutSource>
pub fn attempt_timeout_source(&self) -> Option<AttemptTimeoutSource>
Sourcepub fn unreaped_worker_count(&self) -> u32
pub fn unreaped_worker_count(&self) -> u32
Sourcepub fn attempts(&self) -> u32
pub fn attempts(&self) -> u32
Returns the number of attempts that were executed.
§Returns
The number of operation attempts observed before termination.
Sourcepub fn last_failure(&self) -> Option<&AttemptFailure<E>>
pub fn last_failure(&self) -> Option<&AttemptFailure<E>>
Returns the last failure, if one exists.
§Returns
Some(&AttemptFailure<E>) when at least one attempt failure was observed;
None when the retry flow stopped before any attempt ran.
Sourcepub fn last_error(&self) -> Option<&E>
pub fn last_error(&self) -> Option<&E>
Sourcepub fn into_last_error(self) -> Option<E>
pub fn into_last_error(self) -> Option<E>
Consumes the retry error and returns the last application error when the final failure wraps one.
§Parameters
This method has no parameters.
§Returns
Some(E) when the terminal failure owns an application error; None
when the terminal failure was a timeout, panic, executor failure, or
when no attempt ran.
Sourcepub fn into_parts(
self,
) -> (RetryErrorReason, Option<AttemptFailure<E>>, RetryContext)
pub fn into_parts( self, ) -> (RetryErrorReason, Option<AttemptFailure<E>>, RetryContext)
Trait Implementations§
Source§impl<E: Clone> Clone for RetryError<E>
impl<E: Clone> Clone for RetryError<E>
Source§fn clone(&self) -> RetryError<E>
fn clone(&self) -> RetryError<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 RetryError<E>
impl<E: Debug> Debug for RetryError<E>
Source§impl<'de, E> Deserialize<'de> for RetryError<E>where
E: DeserializeOwned,
impl<'de, E> Deserialize<'de> for RetryError<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 for RetryError<E>where
E: Display,
impl<E> Display for RetryError<E>where
E: Display,
Source§impl<E> Error for RetryError<E>where
E: Error + 'static,
impl<E> Error for RetryError<E>where
E: Error + 'static,
Source§impl<E: PartialEq> PartialEq for RetryError<E>
impl<E: PartialEq> PartialEq for RetryError<E>
Source§fn eq(&self, other: &RetryError<E>) -> bool
fn eq(&self, other: &RetryError<E>) -> bool
self and other values to be equal, and is used by ==.Source§impl<E> Serialize for RetryError<E>where
E: Serialize,
impl<E> Serialize for RetryError<E>where
E: Serialize,
impl<E: Eq> Eq for RetryError<E>
impl<E> StructuralPartialEq for RetryError<E>
Auto Trait Implementations§
impl<E> Freeze for RetryError<E>where
E: Freeze,
impl<E> RefUnwindSafe for RetryError<E>where
E: RefUnwindSafe,
impl<E> Send for RetryError<E>where
E: Send,
impl<E> Sync for RetryError<E>where
E: Sync,
impl<E> Unpin for RetryError<E>where
E: Unpin,
impl<E> UnsafeUnpin for RetryError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for RetryError<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<E> IntoBoxError for E
impl<E> IntoBoxError for E
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.