pub trait Backoff {
// Required method
fn next_backoff(&self) -> impl Future<Output = ()>;
}
Available on crate feature
util
only.Expand description
A backoff trait where a single mutable reference represents a single
backoff session. Implementors must also implement Clone
which will
reset the backoff back to the default state for the next session.
Required Methods§
Sourcefn next_backoff(&self) -> impl Future<Output = ()>
fn next_backoff(&self) -> impl Future<Output = ()>
Initiate the next backoff in the sequence.
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§
impl<R> Backoff for ExponentialBackoff<R>where
R: Rng,
Available on crate feature
util-tokio
only.