Skip to main content

InterfaceOperationalState

Enum InterfaceOperationalState 

Source
#[non_exhaustive]
pub enum InterfaceOperationalState { Up = 1, Down = 2, Testing = 3, Unknown = 4, Dormant = 5, NotPresent = 6, LowerLayerDown = 7, }
Expand description

The operational state of some interface based on IfOperStatus from RFC2863.

Not all states are supported by all systems.

If you want to only distinguish between potentially operational and not operational you likely want to:

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Up = 1

The interface is able to pass packets.

§

Down = 2

The interface is unable to pass packets.

§Examples
  • an error condition has occurred
  • the interface is disabled
§

Testing = 3

The interface is unable to pass packets. The interface is performing some test(s). Presumably it will change into another appropriate state once testing completes.

§Examples
  • driver self-test
  • media (e.g. cable) test
§

Unknown = 4

The state of the interface is unknown. The interface may or may not be usable.

§Examples
  • on linux the loopback interface (localhost, 127.0.0.1/8, ::1/128) typically has this state
§

Dormant = 5

The interface is unable to pass packets. It is in a “pending state” waiting for some external event. When the event occurs the interface will prusumably change into the `Up`` state.

§Examples
  • an “on-demand” interface might be waiting for a package in the transmit queue to establish a connection.
  • an interface might be waiting for the remote system to establish a connection
  • waiting for 802.1X protocol to establish a connection
§

NotPresent = 6

The interface is unable to pass packets. A (hardware) component is not present.

This is a refinement on Down.

§Examples
  • hot-swap module is currently not installed
  • pre-configured interface is not yet installed
  • an interface has been removed but is still configured
§

LowerLayerDown = 7

The interface is unable to pass packets. This interface depends on one or more interfaces and at least one of these interfaces prevents this interface from being Up.

This is a refinement on Down.

§Examples
  • a VPN interface depends on any physical interface being up but the physical interface is testing the cable to determine the available speed
  • a single virtual interface that aggregates multiple physical interfaces but all physical interfaces are down

Trait Implementations§

Source§

impl Clone for InterfaceOperationalState

Source§

fn clone(&self) -> InterfaceOperationalState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for InterfaceOperationalState

Source§

impl Debug for InterfaceOperationalState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for InterfaceOperationalState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for InterfaceOperationalState

Source§

impl PartialEq for InterfaceOperationalState

Source§

fn eq(&self, other: &InterfaceOperationalState) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for InterfaceOperationalState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.