#[non_exhaustive]pub struct KeepAlive {
pub soft: Duration,
pub hard: Duration,
}Expand description
How long a session may go without hearing from its peer: Stale after
soft, closed as Error::IdleTimeout after hard.
The transport probes a peer that stays quiet for half of soft, and any packet the peer
sends counts as hearing it, so a busy session pays nothing. Set it with
Client::with_keep_alive or Server::with_keep_alive, and watch Session::liveness.
Native QUIC and qmux (draft-01 and newer) can probe; any other transport refuses it when the
session opens, as does a hard longer than the transport’s idle timeout, which stays in
force as a backstop.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.soft: DurationHow long the peer may go unheard before it counts as stale.
hard: DurationHow long the peer may go unheard before the session closes.
Implementations§
Trait Implementations§
impl Copy for KeepAlive
impl Eq for KeepAlive
impl StructuralPartialEq for KeepAlive
Auto Trait Implementations§
impl Freeze for KeepAlive
impl RefUnwindSafe for KeepAlive
impl Send for KeepAlive
impl Sync for KeepAlive
impl Unpin for KeepAlive
impl UnsafeUnpin for KeepAlive
impl UnwindSafe for KeepAlive
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
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.