pub struct EthernetAddress(pub [u8; 6]);
Expand description
A six-octet Ethernet II address.
Tuple Fields§
§0: [u8; 6]
Implementations§
Source§impl Address
impl Address
Sourcepub fn from_bytes(data: &[u8]) -> Address
pub fn from_bytes(data: &[u8]) -> Address
Construct an Ethernet address from a sequence of octets, in big-endian.
§Panics
The function panics if data
is not six octets long.
Sourcepub const fn as_bytes(&self) -> &[u8]
pub const fn as_bytes(&self) -> &[u8]
Return an Ethernet address as a sequence of octets, in big-endian.
Sourcepub fn is_unicast(&self) -> bool
pub fn is_unicast(&self) -> bool
Query whether the address is an unicast address.
Sourcepub fn is_broadcast(&self) -> bool
pub fn is_broadcast(&self) -> bool
Query whether this address is the broadcast address.
Sourcepub const fn is_multicast(&self) -> bool
pub const fn is_multicast(&self) -> bool
Query whether the “multicast” bit in the OUI is set.
Trait Implementations§
Source§impl From<Address> for HardwareAddress
impl From<Address> for HardwareAddress
Source§fn from(addr: EthernetAddress) -> Self
fn from(addr: EthernetAddress) -> Self
Converts to this type from the input type.
Source§impl From<Address> for RawHardwareAddress
impl From<Address> for RawHardwareAddress
Source§fn from(addr: EthernetAddress) -> Self
fn from(addr: EthernetAddress) -> Self
Converts to this type from the input type.
Source§impl FromStr for EthernetAddress
impl FromStr for EthernetAddress
Source§impl Ord for Address
impl Ord for Address
Source§impl PartialOrd for Address
impl PartialOrd for Address
impl Copy for Address
impl Eq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
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