pub struct DirectionStats {
pub packets_sent: u64,
pub packets_received: u64,
pub packets_lost: u64,
pub packets_retransmitted: u64,
pub bytes_sent: u64,
pub bytes_received: u64,
pub packet_loss_rate: f64,
pub retransmit_rate: f64,
pub bandwidth_bps: f64,
}Expand description
Per-direction statistics.
Fields§
§packets_sent: u64Total packets sent or expected.
packets_received: u64Total packets received.
packets_lost: u64Packets lost (not received).
packets_retransmitted: u64Packets retransmitted.
bytes_sent: u64Total bytes sent.
bytes_received: u64Total bytes received.
packet_loss_rate: f64Packet loss rate in [0.0, 1.0].
retransmit_rate: f64Retransmit rate in [0.0, 1.0].
bandwidth_bps: f64Estimated bandwidth in bits per second.
Implementations§
Source§impl DirectionStats
impl DirectionStats
Sourcepub fn update_loss_rate(&mut self)
pub fn update_loss_rate(&mut self)
Recalculate packet_loss_rate from packet counts.
Sourcepub fn update_retransmit_rate(&mut self)
pub fn update_retransmit_rate(&mut self)
Recalculate retransmit_rate from packet counts.
Trait Implementations§
Source§impl Clone for DirectionStats
impl Clone for DirectionStats
Source§fn clone(&self) -> DirectionStats
fn clone(&self) -> DirectionStats
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 DirectionStats
impl Debug for DirectionStats
Source§impl Default for DirectionStats
impl Default for DirectionStats
Source§fn default() -> DirectionStats
fn default() -> DirectionStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DirectionStats
impl RefUnwindSafe for DirectionStats
impl Send for DirectionStats
impl Sync for DirectionStats
impl Unpin for DirectionStats
impl UnsafeUnpin for DirectionStats
impl UnwindSafe for DirectionStats
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