pub struct NetworkInfo {
pub name: String,
pub network_type: NetworkType,
pub mac_address: String,
pub ip_addresses: Vec<String>,
pub speed_mbps: Option<u32>,
pub is_up: bool,
pub bytes_received: u64,
pub bytes_transmitted: u64,
pub packets_received: u64,
pub packets_transmitted: u64,
pub receive_errors: u64,
pub transmit_errors: u64,
}Expand description
Network interface information
Fields§
§name: StringInterface name
network_type: NetworkTypeNetwork type
mac_address: StringMAC address
ip_addresses: Vec<String>IP addresses
speed_mbps: Option<u32>Interface speed in Mbps (if available)
is_up: boolIs interface up/active
bytes_received: u64Bytes received
bytes_transmitted: u64Bytes transmitted
packets_received: u64Packets received
packets_transmitted: u64Packets transmitted
receive_errors: u64Receive errors
transmit_errors: u64Transmit errors
Implementations§
Source§impl NetworkInfo
impl NetworkInfo
Sourcepub fn network_type(&self) -> &NetworkType
pub fn network_type(&self) -> &NetworkType
Get network type
Sourcepub fn mac_address(&self) -> &str
pub fn mac_address(&self) -> &str
Get MAC address
Sourcepub fn ip_addresses(&self) -> &[String]
pub fn ip_addresses(&self) -> &[String]
Get IP addresses
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
Get total bytes transferred
Sourcepub fn total_packets(&self) -> u64
pub fn total_packets(&self) -> u64
Get total packets transferred
Sourcepub fn total_errors(&self) -> u64
pub fn total_errors(&self) -> u64
Get total errors
Trait Implementations§
Source§impl Clone for NetworkInfo
impl Clone for NetworkInfo
Source§fn clone(&self) -> NetworkInfo
fn clone(&self) -> NetworkInfo
Returns a duplicate of the value. Read more
1.0.0 · 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 NetworkInfo
impl Debug for NetworkInfo
Source§impl<'de> Deserialize<'de> for NetworkInfo
impl<'de> Deserialize<'de> for NetworkInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NetworkInfo
impl RefUnwindSafe for NetworkInfo
impl Send for NetworkInfo
impl Sync for NetworkInfo
impl Unpin for NetworkInfo
impl UnwindSafe for NetworkInfo
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