sinf 0.1.0

Library for obtaining in-depth system information at both the hardware and software levels
Documentation
use crate::{InterfaceOperationalState, IpNetwork, MacAddr, NetworkDataInner};

/// Reports received and transmitted byte and packet volumes.
pub struct NetworkData {
    pub(crate) inner: NetworkDataInner,
}

impl NetworkData {
    /// Returns the number of bytes received since the last refresh.
    pub fn received(&self) -> u64 {
        self.inner.received()
    }

    /// Returns the total number of bytes received.
    pub fn total_received(&self) -> u64 {
        self.inner.total_received()
    }

    /// Returns the number of bytes transmitted since the last refresh.
    pub fn transmitted(&self) -> u64 {
        self.inner.transmitted()
    }

    /// Returns the total number of bytes transmitted.
    pub fn total_transmitted(&self) -> u64 {
        self.inner.total_transmitted()
    }

    /// Returns the number of incoming packets since the last refresh.
    pub fn packets_received(&self) -> u64 {
        self.inner.packets_received()
    }

    /// Returns the total number of incoming packets.
    pub fn total_packets_received(&self) -> u64 {
        self.inner.total_packets_received()
    }

    /// Returns the number of outgoing packets since the last refresh.
    pub fn packets_transmitted(&self) -> u64 {
        self.inner.packets_transmitted()
    }

    /// Returns the total number of outgoing packets.
    pub fn total_packets_transmitted(&self) -> u64 {
        self.inner.total_packets_transmitted()
    }

    /// Returns the number of incoming errors since the last refresh.
    pub fn errors_on_received(&self) -> u64 {
        self.inner.errors_on_received()
    }

    /// Returns the total number of incoming errors.
    pub fn total_errors_on_received(&self) -> u64 {
        self.inner.total_errors_on_received()
    }

    /// Returns the number of outgoing errors since the last refresh.
    pub fn errors_on_transmitted(&self) -> u64 {
        self.inner.errors_on_transmitted()
    }

    /// Returns the total number of outgoing errors.
    pub fn total_errors_on_transmitted(&self) -> u64 {
        self.inner.total_errors_on_transmitted()
    }

    /// Returns the MAC address of the interface.
    pub fn mac_address(&self) -> MacAddr {
        self.inner.mac_address()
    }

    /// Returns the IP networks associated with the interface.
    pub fn ip_networks(&self) -> &[IpNetwork] {
        self.inner.ip_networks()
    }

    /// Returns the interface's Maximum Transfer Unit (MTU).
    pub fn mtu(&self) -> u64 {
        self.inner.mtu()
    }

    /// Returns the transmit link speed of the interface in bits per second.
    pub fn transmit_link_speed(&self) -> Option<u64> {
        self.inner.transmit_link_speed()
    }

    /// Returns the receive link speed of the interface in bits per second.
    pub fn receive_link_speed(&self) -> Option<u64> {
        self.inner.receive_link_speed()
    }

    /// Returns the operational state of the interface.
    pub fn operational_state(&self) -> InterfaceOperationalState {
        self.inner.operational_state()
    }
}