#[repr(C)]pub struct MacAddr8(pub u8, pub u8, pub u8, pub u8, pub u8, pub u8, pub u8, pub u8);Expand description
64-bit MAC-like address (IEEE EUI-64).
Tuple Fields§
§0: u8§1: u8§2: u8§3: u8§4: u8§5: u8§6: u8§7: u8Implementations§
Source§impl MacAddr8
impl MacAddr8
Sourcepub fn new(a: u8, b: u8, c: u8, d: u8, e: u8, f: u8, g: u8, h: u8) -> MacAddr8
pub fn new(a: u8, b: u8, c: u8, d: u8, e: u8, f: u8, g: u8, h: u8) -> MacAddr8
Constructs a new MacAddr8 from eight octets.
Sourcepub fn from_octets(octets: [u8; 8]) -> MacAddr8
pub fn from_octets(octets: [u8; 8]) -> MacAddr8
Constructs from a [u8; 8] array.
Sourcepub fn address(&self) -> String
pub fn address(&self) -> String
Returns a colon-separated lowercase hex string (xx:xx:xx:xx:xx:xx:xx:xx).
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.
Sourcepub fn from_eui48(mac: MacAddr) -> MacAddr8
pub fn from_eui48(mac: MacAddr) -> MacAddr8
Converts from EUI-48 (MacAddr) to EUI-64 by inserting ff:fe.
Commonly used for IPv6 IID formation from MAC addresses.
Trait Implementations§
Source§impl Ord for MacAddr8
impl Ord for MacAddr8
Source§impl PartialOrd for MacAddr8
impl PartialOrd for MacAddr8
impl Copy for MacAddr8
impl Eq for MacAddr8
impl StructuralPartialEq for MacAddr8
Auto Trait Implementations§
impl Freeze for MacAddr8
impl RefUnwindSafe for MacAddr8
impl Send for MacAddr8
impl Sync for MacAddr8
impl Unpin for MacAddr8
impl UnwindSafe for MacAddr8
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