pub struct WsStats { /* private fields */ }Expand description
WebSocket connection statistics (lock-free).
Implementations§
Source§impl WsStats
impl WsStats
Sourcepub fn record_received(&self, bytes: u64)
pub fn record_received(&self, bytes: u64)
Records a received message.
Sourcepub fn record_sent(&self, bytes: u64)
pub fn record_sent(&self, bytes: u64)
Records a sent message.
Sourcepub fn record_ping(&self)
pub fn record_ping(&self)
Records a ping sent.
Sourcepub fn record_pong(&self)
pub fn record_pong(&self)
Records a pong received.
Sourcepub fn record_connected(&self)
pub fn record_connected(&self)
Records a connection established.
Sourcepub fn increment_reconnect_attempts(&self) -> u32
pub fn increment_reconnect_attempts(&self) -> u32
Increments the reconnection attempt counter.
Sourcepub fn reset_reconnect_attempts(&self)
pub fn reset_reconnect_attempts(&self)
Resets the reconnection attempt counter to zero.
Sourcepub fn last_pong_time(&self) -> i64
pub fn last_pong_time(&self) -> i64
Returns the last pong timestamp.
Sourcepub fn last_ping_time(&self) -> i64
pub fn last_ping_time(&self) -> i64
Returns the last ping timestamp.
Sourcepub fn snapshot(&self) -> WsStatsSnapshot
pub fn snapshot(&self) -> WsStatsSnapshot
Creates an immutable snapshot of current statistics.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WsStats
impl RefUnwindSafe for WsStats
impl Send for WsStats
impl Sync for WsStats
impl Unpin for WsStats
impl UnwindSafe for WsStats
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