pub trait OnRetry<E> {
type Future: Future<Output = ()> + Send + 'static;
// Required method
fn on_retry(
&mut self,
attempt: u32,
next_delay: Option<Duration>,
previous_error: &E,
) -> Self::Future;
}
Expand description
Trait allowing you to run some future when a retry occurs. Could for example to be used for logging or other kinds of telemetry.
You wont have to implement this trait manually. It is implemented for functions with the right
signature. See RetryFuture::on_retry
for more details.