Skip to main content

NetworkInterface

Struct NetworkInterface 

Source
pub struct NetworkInterface<'a> {
    pub name: &'a str,
    pub is_operational: bool,
    pub off_premise_ipv4: Option<bool>,
    pub off_premise_ipv6: Option<bool>,
    pub hardware_address: &'a [u8],
    pub ipv4_addresses: &'a [[u8; 4]],
    pub ipv6_addresses: &'a [[u8; 16]],
    pub interface_type: InterfaceType,
}
Expand description

One entry of NetworkInterfaces (§11.12.5.6).

The IP addresses are borrowed slices of wire-order octets — four each for IPv4, sixteen for IPv6 — because a device already holds them somewhere and this cluster is a view.

Fields§

§name: &'a str

“a human-readable (displayable) name for the network interface, that is different from all other interfaces”, at most 32 octets.

§is_operational: bool

Whether the node is advertising operationally on it and can receive on it.

§off_premise_ipv4: Option<bool>

Whether off-premise services are reachable over IPv4; None writes TLV null, which §11.12.5.6 requires when “the Node does not use such services or does not know”.

§off_premise_ipv6: Option<bool>

The same for IPv6.

§hardware_address: &'a [u8]

“the current link-layer address for a 802.3 or IEEE 802.11-2020 network interface … the current extended MAC address for a 802.15.4 interface”, in wire byte order.

§ipv4_addresses: &'a [[u8; 4]]

Up to four IPv4 addresses, four octets each.

§ipv6_addresses: &'a [[u8; 16]]

Up to eight unicast IPv6 addresses. “This list SHALL include the Node’s link-local address … SHALL NOT include any multicast group addresses.”

§interface_type: InterfaceType

What kind of interface it is.

Trait Implementations§

Source§

impl<'a> Clone for NetworkInterface<'a>

Source§

fn clone(&self) -> Self

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<'a> Copy for NetworkInterface<'a>

Source§

impl<'a> Debug for NetworkInterface<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Forget for NetworkInterface<'a>

§

impl<'a> Freeze for NetworkInterface<'a>

§

impl<'a> Move for NetworkInterface<'a>

§

impl<'a> RefUnwindSafe for NetworkInterface<'a>

§

impl<'a> Send for NetworkInterface<'a>

§

impl<'a> Sync for NetworkInterface<'a>

§

impl<'a> Unpin for NetworkInterface<'a>

§

impl<'a> UnsafeUnpin for NetworkInterface<'a>

§

impl<'a> UnwindSafe for NetworkInterface<'a>

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> Same for T

Source§

type Output = T

Should always be Self
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, 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.