[][src]Struct heim_net::MacAddr8

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

MAC address in EUI-64 format.

Methods

impl MacAddr8[src]

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

Creates a new MacAddr8 address from the bytes.

Example

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

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

Returns true if the address is nil.

Example

let addr = MacAddr8::new(0x00, 0x00, 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 = MacAddr8::new(0xFF, 0xFF, 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 = MacAddr8::new(0x00, 0x01, 0x44, 0x55, 0x66, 0x77, 0xCD, 0xEF);

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

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

Returns true if the address is multicast.

Example

let addr = MacAddr8::new(0x01, 0x00, 0x0C, 0xCC, 0xCC, 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 = MacAddr8::new(0x01, 0x00, 0x0C, 0xCC, 0xCC, 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 = MacAddr8::new(0x02, 0x00, 0x0C, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC);

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

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

Converts a MacAddr8 address to a byte slice.

Example

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

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

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

Consumes a MacAddr8 address and returns raw bytes.

Example

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

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

Trait Implementations

impl From<[u8; 8]> for MacAddr8[src]

impl From<MacAddr8> for MacAddr[src]

impl PartialEq<MacAddr8> for MacAddr8[src]

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

impl FromStr for MacAddr8[src]

type Err = ParseError

The associated error which can be returned from parsing.

impl Display for MacAddr8[src]

impl Hash for MacAddr8[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 PartialOrd<MacAddr8> for MacAddr8[src]

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

impl Copy for MacAddr8[src]

impl Default for MacAddr8[src]

impl Debug for MacAddr8[src]

impl Clone for MacAddr8[src]

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

Performs copy-assignment from source. Read more

impl Ord for MacAddr8[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 Eq for MacAddr8[src]

Auto Trait Implementations

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

impl<T> ToString for T where
    T: Display + ?Sized
[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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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