pub struct PeerStatistics {
pub packets_sent: u64,
pub packets_received: u64,
pub packets_lost: u64,
pub bytes_sent: u64,
pub bytes_received: u64,
}Expand description
Comprehensive statistics for a peer connection. Tracks packets, bytes, and network quality metrics.
Fields§
§packets_sent: u64Total packets sent to this peer
packets_received: u64Total packets received from this peer
packets_lost: u64Total packets lost (detected via ACK timeouts)
bytes_sent: u64Total data bytes sent to this peer (excluding protocol overhead)
bytes_received: u64Total data bytes received from this peer (excluding protocol overhead)
Implementations§
Source§impl PeerStatistics
impl PeerStatistics
Sourcepub fn packet_loss_rate(&self) -> f32
pub fn packet_loss_rate(&self) -> f32
Returns the packet loss rate (0.0 to 1.0).
Trait Implementations§
Source§impl Clone for PeerStatistics
impl Clone for PeerStatistics
Source§fn clone(&self) -> PeerStatistics
fn clone(&self) -> PeerStatistics
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 moreSource§impl Debug for PeerStatistics
impl Debug for PeerStatistics
Source§impl Default for PeerStatistics
impl Default for PeerStatistics
Source§fn default() -> PeerStatistics
fn default() -> PeerStatistics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PeerStatistics
impl RefUnwindSafe for PeerStatistics
impl Send for PeerStatistics
impl Sync for PeerStatistics
impl Unpin for PeerStatistics
impl UnsafeUnpin for PeerStatistics
impl UnwindSafe for PeerStatistics
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