Trait netstack3_base::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.

Object Safety§

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§