pub struct Backoff {
pub base: Duration,
pub max: Duration,
}Expand description
The reconnection delay S2 Connect prescribes.
S2C §Reconnection strategy: delay_n = random(0, min(max_delay, base_delay × 2^n))
with a base of two seconds and a maximum of six hundred.
The randomness is a parameter rather than a call into an RNG, so the core stays pure
and a test can pin it. Backoff::delay_with is the convenience for a driver.
Fields§
§base: DurationThe first delay’s ceiling.
max: DurationThe ceiling no delay exceeds.
Implementations§
Trait Implementations§
impl Copy for Backoff
impl Eq for Backoff
impl StructuralPartialEq for Backoff
Auto Trait Implementations§
impl Forget for Backoff
impl Freeze for Backoff
impl Move 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.