pub enum OperState {
Unknown,
NotPresent,
Down,
LowerLayerDown,
Testing,
Dormant,
Up,
}Expand description
Operational state of a network interface.
See also: https://www.kernel.org/doc/Documentation/networking/operstates.txt
Variants§
Unknown
Interface state is unknown
NotPresent
Interface is not present
Down
Interface is administratively or otherwise down
LowerLayerDown
Interface is down because a lower layer is down
Testing
Interface is in testing state
Dormant
Interface is dormant
Up
Interface is operational
Implementations§
Source§impl OperState
impl OperState
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Return lowercase string representation matching /sys/class/net/*/operstate
Sourcepub fn from_if_flags(if_flags: u32) -> OperState
pub fn from_if_flags(if_flags: u32) -> OperState
Determine the operational state based on interface flags.
This is primarily a fallback mechanism for platforms where
/sys/class/net/*/operstate or native operstate APIs are not available.
On Windows, this method is not used in practice, as the OperState is
obtained through native API calls.
Trait Implementations§
impl Copy for OperState
impl Eq for OperState
impl StructuralPartialEq for OperState
Auto Trait Implementations§
impl Freeze for OperState
impl RefUnwindSafe for OperState
impl Send for OperState
impl Sync for OperState
impl Unpin for OperState
impl UnwindSafe for OperState
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