[][src]Enum heim_net::MacAddr

pub enum MacAddr {
    V6(MacAddr6),
    V8(MacAddr8),
}

A MAC address, either in EUI-48 or EUI-64 format.

Variants

Implementations

impl MacAddr[src]

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

Returns true if the address is MacAddr6 address.

Example

let addr = MacAddr::from([0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67]);

assert_eq!(addr.is_v6(), true);
assert_eq!(addr.is_v8(), false);

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

Returns true if the address is MacAddr8 address.

Example

let addr = MacAddr::from([0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67, 0x89, 0xAB]);

assert_eq!(addr.is_v6(), false);
assert_eq!(addr.is_v8(), true);

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

Converts a MacAddr address to a byte slice.

Length of the returned slice is depends on the enum member used.

Example

let addr = MacAddr::from([0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67]);

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

Trait Implementations

impl Clone for MacAddr[src]

impl Copy for MacAddr[src]

impl Debug for MacAddr[src]

impl Display for MacAddr[src]

impl Eq for MacAddr[src]

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

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

impl From<MacAddr6> for MacAddr[src]

impl From<MacAddr8> for MacAddr[src]

impl FromStr for MacAddr[src]

type Err = ParseError

The associated error which can be returned from parsing.

impl Hash for MacAddr[src]

impl Ord for MacAddr[src]

impl PartialEq<MacAddr> for MacAddr[src]

impl PartialOrd<MacAddr> for MacAddr[src]

impl StructuralEq for MacAddr[src]

impl StructuralPartialEq for MacAddr[src]

Auto Trait Implementations

impl RefUnwindSafe for MacAddr

impl Send for MacAddr

impl Sync for MacAddr

impl Unpin for MacAddr

impl UnwindSafe for MacAddr

Blanket Implementations

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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> 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.