pub trait Backoff:
Send
+ Sync
+ 'static {
// Required methods
fn next_delay(&self, attempt: usize) -> Duration;
fn box_clone(&self) -> Box<dyn Backoff>;
// Provided method
fn reset(&mut self) { ... }
}
Expand description
Trait for backoff strategies used in retry mechanisms
Required Methods§
Sourcefn next_delay(&self, attempt: usize) -> Duration
fn next_delay(&self, attempt: usize) -> Duration
Get the next delay duration based on the current attempt