Skip to main content

BackoffStrategy

Trait BackoffStrategy 

Source
pub trait BackoffStrategy:
    Clone
    + Send
    + Sync
    + 'static {
    // Required method
    fn delay(&self, attempt: u32) -> Duration;
}
Expand description

Defines a backoff strategy for retry delays.

Required Methods§

Source

fn delay(&self, attempt: u32) -> Duration

Calculate the delay before the next retry attempt.

§Arguments
  • attempt - The current attempt number (0-indexed)

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§