pub enum KeepaliveBehavior {
Enabled(KeepalivePolicy),
Disabled,
}Expand description
Whether a client pings its peer on a schedule.
ConnectOptions defaults this to Enabled(KeepalivePolicy::default()) - a charge point on a
NAT’d or mobile link needs keepalive to notice a half-open connection at all, the same
reasoning that makes ReconnectBehavior default to enabled. The lower-level
Client::from_transport* constructors default to Disabled, since a caller assembling a
client from raw transport halves has said nothing about wanting background traffic on it.
Disabled is not permanent: Client::set_ping_interval can turn pinging on later, which is
what a CSMS writing WebSocketPingInterval via SetVariables needs to be able to do.
Variants§
Enabled(KeepalivePolicy)
Disabled
Trait Implementations§
Source§impl Clone for KeepaliveBehavior
impl Clone for KeepaliveBehavior
Source§fn clone(&self) -> KeepaliveBehavior
fn clone(&self) -> KeepaliveBehavior
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 KeepaliveBehavior
Source§impl Debug for KeepaliveBehavior
impl Debug for KeepaliveBehavior
Source§impl Default for KeepaliveBehavior
impl Default for KeepaliveBehavior
Source§fn default() -> KeepaliveBehavior
fn default() -> KeepaliveBehavior
Returns the “default value” for a type. Read more
impl Eq for KeepaliveBehavior
Source§impl PartialEq for KeepaliveBehavior
impl PartialEq for KeepaliveBehavior
impl StructuralPartialEq for KeepaliveBehavior
Auto Trait Implementations§
impl Freeze for KeepaliveBehavior
impl RefUnwindSafe for KeepaliveBehavior
impl Send for KeepaliveBehavior
impl Sync for KeepaliveBehavior
impl Unpin for KeepaliveBehavior
impl UnsafeUnpin for KeepaliveBehavior
impl UnwindSafe for KeepaliveBehavior
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