Module retry

Module retry 

Source
Expand description

A retry strategy that works with rusts native std::error::Error type.

TODO: Could make the impl of RetryableError trait into a proc-macro to auto-derive Retryable on annotated enum variants.

#[derive(Debug, Error)]
enum ErrorFoo {
    #[error("I am retryable")]
    #[retryable]
    Retryable,
    #[error("Nested errors are retryable")]
    #[retryable(inherit)]
    NestedRetryable(AnotherErrorWithRetryableVariants),
    #[error("Always fail")]
    NotRetryable
}

Structs§

ExponentialBackoff
ExponentialBackoffBuilder
NotSpecialized
Retry
Options to specify how to retry a function
RetryBuilder
Builder for Retry

Traits§

RetryableError
Specifies which errors are retryable. All Errors are not retryable by-default.
Strategy
The strategy interface

Functions§

arc_retryable_to_error
Convert an Arc<[RetryableError]> to a Standard Library Arc<Error>

Type Aliases§

BoxedRetry