gcp_sdk_gax::backoff_policy

Trait BackoffPolicy

Source
pub trait BackoffPolicy:
    Send
    + Sync
    + Debug {
    // Required method
    fn on_failure(&self, loop_start: Instant, attempt_count: u32) -> Duration;
}
Expand description

Defines the trait implemented by all backoff strategies.

Required Methods§

Source

fn on_failure(&self, loop_start: Instant, attempt_count: u32) -> Duration

Returns the backoff delay on a failure.

§Parameters
  • loop_start - when the retry loop started.
  • attempt_count - the number of attempts. This method is always called after the first attempt.

Implementors§