pub struct MacAddr(pub u8, pub u8, pub u8, pub u8, pub u8, pub u8);
Expand description
A MAC address.
Tuple Fields§
§0: u8
§1: u8
§2: u8
§3: u8
§4: u8
§5: u8
Implementations§
Source§impl MacAddr
impl MacAddr
Sourcepub fn new(a: u8, b: u8, c: u8, d: u8, e: u8, f: u8) -> MacAddr
pub fn new(a: u8, b: u8, c: u8, d: u8, e: u8, f: u8) -> MacAddr
Construct a new MacAddr
instance.
Sourcepub fn is_universal(&self) -> bool
pub fn is_universal(&self) -> bool
Returns true if the MacAddr is a universally administered addresses (UAA).
Sourcepub fn is_local(&self) -> bool
pub fn is_local(&self) -> bool
Returns true if the MacAddr is a locally administered addresses (LAA).
Sourcepub fn is_unicast(&self) -> bool
pub fn is_unicast(&self) -> bool
Returns true if the MacAddr is a unicast address.
Sourcepub fn is_multicast(&self) -> bool
pub fn is_multicast(&self) -> bool
Returns true if the MacAddr is a multicast address.
Sourcepub fn is_broadcast(&self) -> bool
pub fn is_broadcast(&self) -> bool
Returns true if the MacAddr is a broadcast address.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MacAddr
impl<'de> Deserialize<'de> for MacAddr
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserializes the MAC address.
It deserializes it from either a byte array (of size 6) or a string. If the format is self-descriptive (like JSON or MessagePack), it auto-detects it. If not, it obeys the human-readable property of the deserializer.
Source§impl Ord for MacAddr
impl Ord for MacAddr
Source§impl PartialOrd for MacAddr
impl PartialOrd for MacAddr
Source§impl PrimitiveValues for MacAddr
impl PrimitiveValues for MacAddr
impl Copy for MacAddr
impl Eq for MacAddr
impl StructuralPartialEq for MacAddr
Auto Trait Implementations§
impl Freeze for MacAddr
impl RefUnwindSafe for MacAddr
impl Send for MacAddr
impl Sync for MacAddr
impl Unpin for MacAddr
impl UnwindSafe for MacAddr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more