Struct embassy_net::EthernetAddress
source · 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: Address) -> HardwareAddress
fn from(addr: Address) -> HardwareAddress
Converts to this type from the input type.
source§impl Ord for Address
impl Ord for Address
source§impl PartialEq<Address> for Address
impl PartialEq<Address> for Address
source§impl PartialOrd<Address> for Address
impl PartialOrd<Address> for Address
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more