Enum backoff::Error[][src]

pub enum Error<E> {
    Permanent(E),
    Transient {
        err: E,
        retry_after: Option<Duration>,
    },
}
Expand description

Error is the error value in an operation’s result.

Based on the two possible values, the operation may be retried.

Variants

Permanent(E)

Tuple Fields

0: E

Permanent means that it’s impossible to execute the operation successfully. This error is immediately returned from retry().

Transient

Fields

err: E
retry_after: Option<Duration>

Transient means that the error is temporary. If the retry_after is None the operation should be retried according to the backoff policy, else after the specified duration. Useful for handling ratelimits like a HTTP 429 response.

Implementations

Creates a transient error which is retried after the specified duration. Useful for handling ratelimits like a HTTP 429 response.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

The lower-level source of this error, if any. Read more

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

By default all errors are transient. Permanent errors can be constructed explicitly. This implementation is for making the question mark operator (?) and the try! macro to work.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.