pub struct Session {
pub interval: Duration,
pub we_refresh: bool,
}Expand description
A live session timer: the agreed interval and which side keeps it alive.
Fields§
§interval: DurationThe negotiated interval.
we_refresh: boolWhether this side sends the refreshes.
Implementations§
Source§impl Session
impl Session
Sourcepub fn act_after(self) -> Duration
pub fn act_after(self) -> Duration
How long after the last refresh this side should act.
Two different deadlines, because the two roles do different things. The refresher sends
at half the interval (RFC 4028 §7.2), which leaves a whole half-interval to notice a
failure and retry. The other side waits nearly the whole interval and then hangs up,
stopping short by min(32s, interval/3) so the BYE goes out before any middlebox on
the path decides the session is over (§10).
Trait Implementations§
impl Copy for Session
impl Eq for Session
impl StructuralPartialEq for Session
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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