pub struct Backoff {
pub initial: Duration,
pub ceiling: Duration,
pub factor: u32,
}Expand description
The inter-probe sleep schedule for eventually and
eventually_blocking.
After a failed probe the helper naps, then doubles (or multiplies by
factor) the nap each time, never exceeding ceiling. The final nap before
the deadline is additionally clamped to the remaining time, so the helper
never oversleeps past its own timeout and skips a last probe.
Fields§
§initial: DurationThe first inter-probe nap.
ceiling: DurationThe longest a single inter-probe nap may grow to.
factor: u32The multiplier applied to the nap after each failed probe. A factor
of 1 makes the nap constant; values below 1 are not possible.
Trait Implementations§
impl Copy for Backoff
impl Eq for Backoff
impl StructuralPartialEq for Backoff
Auto Trait Implementations§
impl Freeze for Backoff
impl RefUnwindSafe for Backoff
impl Send for Backoff
impl Sync for Backoff
impl Unpin for Backoff
impl UnsafeUnpin for Backoff
impl UnwindSafe for Backoff
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more