pub enum OperState {
Unknown,
NotPresent,
Down,
LowerLayerDown,
Testing,
Dormant,
Up,
}Expand description
Operational state of a network interface.
This enum models the common states used by Linux and maps equivalent states from other platforms when possible.
See also: https://www.kernel.org/doc/Documentation/networking/operstates.txt
Variants§
Unknown
Interface state could not be determined.
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
Returns the lowercase representation used by Linux operstate files.
Sourcepub fn from_if_flags(if_flags: u32) -> Self
pub fn from_if_flags(if_flags: u32) -> Self
Derives an operational state from raw interface flags.
This is used as a fallback when no dedicated operstate API is available. The result is necessarily less precise than native platform state reporting.
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 UnsafeUnpin 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