[][src]Struct macaddr::MacAddr6

#[repr(C)]
pub struct MacAddr6(_);

MAC address in EUI-48 format.

Methods

impl MacAddr6[src]

pub const fn new(a: u8, b: u8, c: u8, d: u8, e: u8, f: u8) -> MacAddr6[src]

Creates a new MacAddr6 address from the bytes.

Example

let addr = MacAddr6::new(0x01, 0x23, 0x45, 0x67, 0x89, 0xAB);

pub fn is_nil(&self) -> bool[src]

Returns true if the address is nil.

Example

let addr = MacAddr6::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00);

assert_eq!(addr.is_nil(), true);

pub fn is_broadcast(&self) -> bool[src]

Returns true if the address is broadcast.

Example

let addr = MacAddr6::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);

assert_eq!(addr.is_broadcast(), true);

pub const fn is_unicast(&self) -> bool[src]

Returns true if the address is unicast.

Example

let addr = MacAddr6::new(0x00, 0x01, 0x44, 0x55, 0x66, 0x77);

assert_eq!(addr.is_unicast(), true);

pub const fn is_multicast(&self) -> bool[src]

Returns true if the address is multicast.

Example

let addr = MacAddr6::new(0x01, 0x00, 0x0C, 0xCC, 0xCC, 0xCC);

assert_eq!(addr.is_multicast(), true);

pub const fn is_universal(&self) -> bool[src]

Returns true if the address is universally administered address (UAA).

Example

let addr = MacAddr6::new(0x01, 0x00, 0x0C, 0xCC, 0xCC, 0xCC);

assert_eq!(addr.is_universal(), true);

pub const fn is_local(&self) -> bool[src]

Returns true if the address is locally administered (LAA).

Example

let addr = MacAddr6::new(0x02, 0x00, 0x0C, 0xCC, 0xCC, 0xCC);

assert_eq!(addr.is_local(), true);

pub fn as_bytes(&self) -> &[u8][src]

Converts a MacAddr6 address to a byte slice.

Example

let addr = MacAddr6::new(0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67);

assert_eq!(addr.as_bytes(), &[0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67]);

pub const fn into_array(self) -> [u8; 6][src]

Consumes MacAddr6 address and returns raw bytes array.

Example

let addr = MacAddr6::new(0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67);

assert_eq!(addr.into_array(), [0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67]);

Trait Implementations

impl PartialEq<MacAddr6> for MacAddr6[src]

impl AsRef<[u8]> for MacAddr6[src]

impl From<MacAddr6> for MacAddr[src]

impl From<[u8; 6]> for MacAddr6[src]

impl Clone for MacAddr6[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Ord for MacAddr6[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl Default for MacAddr6[src]

impl Eq for MacAddr6[src]

impl Copy for MacAddr6[src]

impl PartialOrd<MacAddr6> for MacAddr6[src]

impl AsMut<[u8]> for MacAddr6[src]

impl Debug for MacAddr6[src]

impl Display for MacAddr6[src]

impl FromStr for MacAddr6[src]

type Err = ParseError

The associated error which can be returned from parsing.

impl Hash for MacAddr6[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Serialize for MacAddr6[src]

impl<'de> Deserialize<'de> for MacAddr6[src]

Auto Trait Implementations

impl Send for MacAddr6

impl Sync for MacAddr6

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]