Skip to main content

AttemptFailure

Enum AttemptFailure 

Source
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>

Source

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.

Source

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.

Source

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.

Source

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>

Source§

fn clone(&self) -> AttemptFailure<E>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E: Debug> Debug for AttemptFailure<E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, E> Deserialize<'de> for AttemptFailure<E>

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<E: Display> Display for AttemptFailure<E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E: PartialEq> PartialEq for AttemptFailure<E>

Source§

fn eq(&self, other: &AttemptFailure<E>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<E> Serialize for AttemptFailure<E>
where E: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<E: Eq> Eq for AttemptFailure<E>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, D> IntoConfigDefault<T> for D
where D: IntoValueDefault<T>,

Source§

fn into_config_default(self) -> T

Converts this fallback value into T.
Source§

impl<T> IntoResult<T> for T

Source§

impl<T> IntoValueDefault<T> for T

Source§

fn into_value_default(self) -> T

Converts this argument into the default value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,