netstack3_base

Trait LinkAddress

Source
pub trait LinkAddress:
    'static
    + FromBytes
    + IntoBytes
    + KnownLayout
    + Immutable
    + Unaligned
    + Copy
    + Clone
    + Debug
    + Eq
    + Send {
    const BYTES_LENGTH: usize;

    // Required methods
    fn bytes(&self) -> &[u8] ;
    fn from_bytes(bytes: &[u8]) -> Self;
}
Expand description

The type of address used by a link device.

Required Associated Constants§

Source

const BYTES_LENGTH: usize

The length of the address in bytes.

Required Methods§

Source

fn bytes(&self) -> &[u8]

Returns the underlying bytes of a LinkAddress.

Source

fn from_bytes(bytes: &[u8]) -> Self

Constructs a LinkLayerAddress from the provided bytes.

§Panics

from_bytes may panic if bytes is not exactly [BYTES_LENGTH] long.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl LinkAddress for Mac

Source§

const BYTES_LENGTH: usize = 6usize

Source§

fn bytes(&self) -> &[u8]

Source§

fn from_bytes(bytes: &[u8]) -> Self

Implementors§