Trait Retryable

Source
pub trait Retryable {
    // Required methods
    fn max_retries() -> u32;
    fn default_initial_delay() -> Duration;
    fn log_level() -> Option<Level>;
    fn custom_retry_policy(&self) -> Option<RetryPolicy>;

    // Provided methods
    fn new_backoff() -> ErrorBackoff<Self> { ... }
    fn retry_config() -> RetryFutureConfig<ErrorBackoff<Self>, LogOnRetry> { ... }
}
Expand description

The Retryable trait allows an error type to define retry logic for specific errors.

Required Methods§

Source

fn max_retries() -> u32

Return the maximum number of retries.

Source

fn default_initial_delay() -> Duration

Return the default initial delay.

Source

fn log_level() -> Option<Level>

Return the log level for this error type (an empty value indicates that no logging will be done).

Source

fn custom_retry_policy(&self) -> Option<RetryPolicy>

Return a retry policy for the given error value.

An empty value represents the default.

Provided Methods§

Source

fn new_backoff() -> ErrorBackoff<Self>

Generate a new backoff strategy instance.

Source

fn retry_config() -> RetryFutureConfig<ErrorBackoff<Self>, LogOnRetry>

Generate a new retry configuration instance.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Retryable for wayback_rs::cdx::Error

Source§

impl Retryable for wayback_rs::downloader::Error