pub struct Interface {
pub name: String,
pub index: u32,
pub mac_address: Option<MacAddress>,
pub mtu: u32,
pub is_up: bool,
pub is_running: bool,
pub kind: InterfaceKind,
pub ipv4: Vec<IpNetwork>,
pub ipv6: Vec<IpNetwork>,
pub stats: InterfaceStats,
}Expand description
Represents a network interface
Fields§
§name: String§index: u32§mac_address: Option<MacAddress>§mtu: u32§is_up: bool§is_running: bool§kind: InterfaceKind§ipv4: Vec<IpNetwork>§ipv6: Vec<IpNetwork>§stats: InterfaceStatsImplementations§
Source§impl Interface
impl Interface
Sourcepub const fn interface_type(&self) -> &InterfaceKind
pub const fn interface_type(&self) -> &InterfaceKind
Get interface type
Sourcepub fn ip_addresses(&self) -> Vec<String>
pub fn ip_addresses(&self) -> Vec<String>
Get all IP addresses
Sourcepub fn is_loopback(&self) -> bool
pub fn is_loopback(&self) -> bool
Check if interface is a loopback interface
Trait Implementations§
impl Eq for Interface
Auto Trait Implementations§
impl Freeze for Interface
impl RefUnwindSafe for Interface
impl Send for Interface
impl Sync for Interface
impl Unpin for Interface
impl UnsafeUnpin for Interface
impl UnwindSafe for Interface
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