pub struct Timers {
pub t1: Duration,
pub t2: Duration,
pub t4: Duration,
}Expand description
The three constants everything else is derived from.
Fields§
§t1: DurationRound-trip estimate. The base of every backoff.
t2: DurationCeiling for retransmission intervals.
t4: DurationLongest a message can linger in the network.
Implementations§
Source§impl Timers
impl Timers
Sourcepub fn timer_d(&self, reliability: Reliability) -> Duration
pub fn timer_d(&self, reliability: Reliability) -> Duration
Timer D: at least 32 s on an unreliable transport, nothing on a reliable one.
The RFC gives 32 s rather than a multiple of T1 because the purpose is to outlast response retransmissions from the other end, whose T1 we do not know.
Sourcepub fn absorb(&self, reliability: Reliability) -> Duration
pub fn absorb(&self, reliability: Reliability) -> Duration
Timer I and Timer K: T4 unreliable, zero reliable.
Sourcepub fn timer_j(&self, reliability: Reliability) -> Duration
pub fn timer_j(&self, reliability: Reliability) -> Duration
Timer J: 64·T1 unreliable, zero reliable.
Sourcepub fn double(&self, current: Duration) -> Duration
pub fn double(&self, current: Duration) -> Duration
The next retransmission interval, doubling without a ceiling — Timer A.
Sourcepub fn double_capped(&self, current: Duration) -> Duration
pub fn double_capped(&self, current: Duration) -> Duration
The next retransmission interval, doubling but capped at T2 — Timers E and G.
Sourcepub fn trying_100(&self) -> Duration
pub fn trying_100(&self) -> Duration
How long a server transaction waits before sending 100 Trying on its own initiative.
Trait Implementations§
impl Copy for Timers
Auto Trait Implementations§
impl Freeze for Timers
impl RefUnwindSafe for Timers
impl Send for Timers
impl Sync for Timers
impl Unpin for Timers
impl UnsafeUnpin for Timers
impl UnwindSafe for Timers
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