Struct powerline::EtherAddr[][src]

#[repr(transparent)]pub struct EtherAddr(pub [u8; 6]);

Implementations

impl EtherAddr[src]

pub const SIZE: usize[src]

pub const NULL: EtherAddr[src]

pub const BROADCAST: EtherAddr[src]

pub const QUALCOMM_LOCALCAST: EtherAddr[src]

pub const IEEE1905_MULTICAST: EtherAddr[src]

pub fn from_slice(slice: &[u8]) -> EtherAddr[src]

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

pub fn oui(&self) -> OUI[src]

pub fn padded(&self) -> [u8; 8][src]

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

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

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

Methods from Deref<Target = [u8; 6]>

pub fn as_slice(&self) -> &[T][src]

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

Returns a slice containing the entire array. Equivalent to &s[..].

pub fn each_ref(&self) -> [&T; N][src]

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

Borrows each element and returns an array of references with the same size as self.

Example

#![feature(array_methods)]

let floats = [3.1, 2.7, -1.0];
let float_refs: [&f64; 3] = floats.each_ref();
assert_eq!(float_refs, [&3.1, &2.7, &-1.0]);

This method is particularly useful if combined with other methods, like map. This way, you can can avoid moving the original array if its elements are not Copy.

#![feature(array_methods, array_map)]

let strings = ["Ferris".to_string(), "♥".to_string(), "Rust".to_string()];
let is_ascii = strings.each_ref().map(|s| s.is_ascii());
assert_eq!(is_ascii, [true, false, true]);

// We can still access the original array: it has not been moved.
assert_eq!(strings.len(), 3);

Trait Implementations

impl Clone for EtherAddr[src]

impl Copy for EtherAddr[src]

impl Debug for EtherAddr[src]

impl Default for EtherAddr[src]

impl Deref for EtherAddr[src]

type Target = [u8; 6]

The resulting type after dereferencing.

impl Eq for EtherAddr[src]

impl FromStr for EtherAddr[src]

type Err = ()

The associated error which can be returned from parsing.

impl Hash for EtherAddr[src]

impl PartialEq<EtherAddr> for EtherAddr[src]

impl StructuralEq for EtherAddr[src]

impl StructuralPartialEq for EtherAddr[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.