pub trait BackoffStrategy: Send + Sync {
// Required method
fn delay_for_attempt(&self, attempt_number: u32) -> Duration;
}Expand description
A strategy for computing retry delay based on attempt number.
Required Methods§
Sourcefn delay_for_attempt(&self, attempt_number: u32) -> Duration
fn delay_for_attempt(&self, attempt_number: u32) -> Duration
Returns the delay before the given attempt should be retried.
attempt_number is 1-indexed: the first retry after the initial attempt
is attempt_number = 1.