pub struct KeepalivePolicy {
pub interval: Duration,
pub timeout: Option<Duration>,
pub max_missed: u32,
}Expand description
How often to ping, how long to wait for each pong, and how many consecutive misses mean the connection is dead.
Fields§
§interval: DurationDelay between pings. Duration::ZERO disables pinging, matching how OCPP’s
WebSocketPingInterval reads a 0 value.
timeout: Option<Duration>How long to wait for each pong before counting it as missed. None uses the client’s
own request timeout, which is what almost every caller wants - a pong that takes longer
than a CALL is already a broken link.
max_missed: u32Consecutive missed pongs before the connection is treated as dead and redialled. 0 is
treated as 1. Defaults to 2 so a single dropped frame - or a peer that answers one
ping oddly - doesn’t cost a reconnect.
Implementations§
Trait Implementations§
Source§impl Clone for KeepalivePolicy
impl Clone for KeepalivePolicy
Source§fn clone(&self) -> KeepalivePolicy
fn clone(&self) -> KeepalivePolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for KeepalivePolicy
Source§impl Debug for KeepalivePolicy
impl Debug for KeepalivePolicy
Source§impl Default for KeepalivePolicy
impl Default for KeepalivePolicy
impl Eq for KeepalivePolicy
Source§impl PartialEq for KeepalivePolicy
impl PartialEq for KeepalivePolicy
impl StructuralPartialEq for KeepalivePolicy
Auto Trait Implementations§
impl Freeze for KeepalivePolicy
impl RefUnwindSafe for KeepalivePolicy
impl Send for KeepalivePolicy
impl Sync for KeepalivePolicy
impl Unpin for KeepalivePolicy
impl UnsafeUnpin for KeepalivePolicy
impl UnwindSafe for KeepalivePolicy
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