pub struct MacAddr(pub u8, pub u8, pub u8, pub u8, pub u8, pub u8);Expand description
48-bit MAC address (IEEE EUI-48).
Tuple Fields§
§0: u8§1: u8§2: u8§3: u8§4: u8§5: u8Implementations§
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
Constructs a new MacAddr from six octets.
Sourcepub fn from_octets(octets: [u8; 6]) -> MacAddr
pub fn from_octets(octets: [u8; 6]) -> MacAddr
Constructs from a [u8; 6] array.
Sourcepub fn address(&self) -> String
pub fn address(&self) -> String
Returns a colon-separated lowercase hex string (xx:xx:xx:xx:xx:xx).
Sourcepub fn from_hex_format(hex_mac_addr: &str) -> MacAddr
pub fn from_hex_format(hex_mac_addr: &str) -> MacAddr
Parses a fixed-width hex string (xx:xx:xx:xx:xx:xx).
pub fn is_broadcast(&self) -> bool
Sourcepub fn is_multicast(&self) -> bool
pub fn is_multicast(&self) -> bool
Returns true if the address is multicast.
Sourcepub fn is_unicast(&self) -> bool
pub fn is_unicast(&self) -> bool
Returns true if the address is unicast.
Sourcepub fn is_locally_administered(&self) -> bool
pub fn is_locally_administered(&self) -> bool
Returns true if the address is locally administered.
Sourcepub fn is_universal(&self) -> bool
pub fn is_universal(&self) -> bool
Returns true if the address is universally administered.
Trait Implementations§
Source§impl Ord for MacAddr
impl Ord for MacAddr
Source§impl PartialOrd for MacAddr
impl PartialOrd 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