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§
Sourcefn max_retries() -> u32
fn max_retries() -> u32
Return the maximum number of retries.
Sourcefn default_initial_delay() -> Duration
fn default_initial_delay() -> Duration
Return the default initial delay.
Sourcefn log_level() -> Option<Level>
fn log_level() -> Option<Level>
Return the log level for this error type (an empty value indicates that no logging will be done).
Sourcefn custom_retry_policy(&self) -> Option<RetryPolicy>
fn custom_retry_policy(&self) -> Option<RetryPolicy>
Return a retry policy for the given error value.
An empty value represents the default.
Provided Methods§
Sourcefn new_backoff() -> ErrorBackoff<Self>
fn new_backoff() -> ErrorBackoff<Self>
Generate a new backoff strategy instance.
Sourcefn retry_config() -> RetryFutureConfig<ErrorBackoff<Self>, LogOnRetry>
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.