pub struct MacAddress([u8; 6]);Expand description
MAC (Media Access Control) address
Tuple Fields§
§0: [u8; 6]Implementations§
Source§impl MacAddress
impl MacAddress
Sourcepub fn from_slice(bytes: &[u8]) -> Result<Self, &'static str>
pub fn from_slice(bytes: &[u8]) -> Result<Self, &'static str>
Create a MAC address from a slice (must be exactly 6 bytes)
Sourcepub fn is_broadcast(&self) -> bool
pub fn is_broadcast(&self) -> bool
Check if this is a broadcast MAC address (FF:FF:FF:FF:FF:FF)
Sourcepub fn is_multicast(&self) -> bool
pub fn is_multicast(&self) -> bool
Check if this is a multicast MAC address (first bit of first byte is 1)
Sourcepub fn is_unicast(&self) -> bool
pub fn is_unicast(&self) -> bool
Check if this is a unicast MAC address (not multicast)
Trait Implementations§
Source§impl Clone for MacAddress
impl Clone for MacAddress
Source§fn clone(&self) -> MacAddress
fn clone(&self) -> MacAddress
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MacAddress
impl Debug for MacAddress
Source§impl PartialEq for MacAddress
impl PartialEq for MacAddress
impl Copy for MacAddress
impl Eq for MacAddress
impl StructuralPartialEq for MacAddress
Auto Trait Implementations§
impl Freeze for MacAddress
impl RefUnwindSafe for MacAddress
impl Send for MacAddress
impl Sync for MacAddress
impl Unpin for MacAddress
impl UnwindSafe for MacAddress
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.