pub struct NetworkInterface {
pub name: String,
pub description: String,
pub index: u32,
pub mac: Option<MacAddr>,
pub ips: Vec<IpNetwork>,
pub flags: u32,
}
Expand description
Represents a network interface and its associated addresses.
Fields§
§name: String
The name of the interface.
description: String
A description of the interface.
index: u32
The interface index (operating system specific).
mac: Option<MacAddr>
A MAC address for the interface.
ips: Vec<IpNetwork>
IP addresses and netmasks for the interface.
flags: u32
Operating system specific flags for the interface.
Implementations§
Source§impl NetworkInterface
impl NetworkInterface
pub fn is_up(&self) -> bool
pub fn is_broadcast(&self) -> bool
Sourcepub fn is_loopback(&self) -> bool
pub fn is_loopback(&self) -> bool
Is the interface a loopback interface?
pub fn is_point_to_point(&self) -> bool
pub fn is_multicast(&self) -> bool
Sourcepub fn is_lower_up(&self) -> bool
pub fn is_lower_up(&self) -> bool
Triggered when the driver has signated netif_carrier_on Check https://www.kernel.org/doc/html/latest/networking/operstates.html for more information
Sourcepub fn is_dormant(&self) -> bool
pub fn is_dormant(&self) -> bool
Triggered when the driver has signated netif_dormant_on Check https://www.kernel.org/doc/html/latest/networking/operstates.html for more information
pub fn is_running(&self) -> bool
Trait Implementations§
Source§impl Clone for NetworkInterface
impl Clone for NetworkInterface
Source§fn clone(&self) -> NetworkInterface
fn clone(&self) -> NetworkInterface
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 NetworkInterface
impl Debug for NetworkInterface
Source§impl<'de> Deserialize<'de> for NetworkInterface
impl<'de> Deserialize<'de> for NetworkInterface
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
Source§impl Display for NetworkInterface
impl Display for NetworkInterface
Source§impl Hash for NetworkInterface
impl Hash for NetworkInterface
Source§impl PartialEq for NetworkInterface
impl PartialEq for NetworkInterface
Source§impl Serialize for NetworkInterface
impl Serialize for NetworkInterface
impl Eq for NetworkInterface
impl StructuralPartialEq for NetworkInterface
Auto Trait Implementations§
impl Freeze for NetworkInterface
impl RefUnwindSafe for NetworkInterface
impl Send for NetworkInterface
impl Sync for NetworkInterface
impl Unpin for NetworkInterface
impl UnwindSafe for NetworkInterface
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