pub struct InterfaceStats {
pub interface_name: String,
pub rx_bytes: u64,
pub tx_bytes: u64,
pub rx_packets: u64,
pub tx_packets: u64,
pub rx_errors: u64,
pub tx_errors: u64,
pub rx_dropped: u64,
pub tx_dropped: u64,
pub collisions: u64,
pub timestamp: SystemTime,
}Expand description
Statistics for a network interface
Fields§
§interface_name: String§rx_bytes: u64§tx_bytes: u64§rx_packets: u64§tx_packets: u64§rx_errors: u64§tx_errors: u64§rx_dropped: u64§tx_dropped: u64§collisions: u64§timestamp: SystemTimeImplementations§
Source§impl InterfaceStats
impl InterfaceStats
Sourcepub fn calculate_rates(&self, previous: &InterfaceStats) -> InterfaceRates
pub fn calculate_rates(&self, previous: &InterfaceStats) -> InterfaceRates
Calculate rates from two snapshots
Sourcepub fn traffic_since(&self, previous: &InterfaceStats) -> InterfaceTrafficWindow
pub fn traffic_since(&self, previous: &InterfaceStats) -> InterfaceTrafficWindow
Calculate traffic transferred between two cumulative snapshots.
Trait Implementations§
Source§impl Clone for InterfaceStats
impl Clone for InterfaceStats
Source§fn clone(&self) -> InterfaceStats
fn clone(&self) -> InterfaceStats
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 moreAuto Trait Implementations§
impl Freeze for InterfaceStats
impl RefUnwindSafe for InterfaceStats
impl Send for InterfaceStats
impl Sync for InterfaceStats
impl Unpin for InterfaceStats
impl UnsafeUnpin for InterfaceStats
impl UnwindSafe for InterfaceStats
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