#[non_exhaustive]pub struct Interface {
pub name: String,
pub index: u32,
pub description: Option<String>,
pub kind: InterfaceKind,
pub mac: Option<Mac>,
pub addresses: Vec<IpNet>,
pub up: bool,
pub running: bool,
pub mtu: Option<u32>,
pub speed_mbps: Option<u64>,
pub is_physical: bool,
}Expand description
One network interface.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe name: eth0, en0, Ethernet 2 (UTF-8; converted lossily).
index: u32The OS’s interface index.
description: Option<String>The friendly description (Windows).
kind: InterfaceKindWhat kind of interface it is.
mac: Option<Mac>The hardware address, when it has one (E-53).
addresses: Vec<IpNet>The addresses with their prefix lengths.
up: boolAdministratively up.
running: boolLink up, operational.
mtu: Option<u32>The MTU, when reported (and details was set).
speed_mbps: Option<u64>The link speed in megabits per second, when the driver reports it (E-58).
is_physical: boolBacked by hardware, rather than a virtual or tunnel interface.
Trait Implementations§
impl Eq for Interface
impl StructuralPartialEq for Interface
Auto Trait Implementations§
impl Forget for Interface
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