Skip to main content

RetryCallback

Trait RetryCallback 

Source
pub trait RetryCallback: Send + Sync {
    // Required method
    fn on_retry(
        &self,
        attempt: usize,
        max_retries: usize,
        delay_secs: u64,
        reason: String,
    );
}
Expand description

Callback invoked each time a retry is about to happen.

The implementer can use this to emit events or log the retry.

Required Methods§

Source

fn on_retry( &self, attempt: usize, max_retries: usize, delay_secs: u64, reason: String, )

Called before sleeping for delay_secs.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§