Enum HardwareAddress
pub enum HardwareAddress {
Ethernet(Address),
Ip,
Ieee802154(Address),
}Expand description
A hardware (link-layer) address.
Which variants exist depends on the enabled medium-* features. In a build
that only drives Medium::Ip interfaces this type has a single variant and
takes up no space.
Variants§
Ethernet(Address)
An Ethernet (MAC) address. Requires the medium-ethernet feature.
Ip
No address, for interfaces that send and receive bare IP packets.
Requires the medium-ip feature.
Ieee802154(Address)
An IEEE 802.15.4 address. Requires the medium-ieee802154 feature.
Implementations§
§impl HardwareAddress
impl HardwareAddress
pub fn is_unicast(&self) -> bool
pub fn is_unicast(&self) -> bool
Query whether the address is an unicast address.
false for Ip.
pub fn is_broadcast(&self) -> bool
pub fn is_broadcast(&self) -> bool
Query whether the address is the broadcast address of its medium.
false for Ip.
pub fn as_eui_64(&self) -> Option<[u8; 8]>
pub fn as_eui_64(&self) -> Option<[u8; 8]>
Convert the address to a modified EUI-64 interface identifier.
None for Ip, and for a short or absent 802.15.4 address.
pub const fn ieee802154(&self) -> Option<Address>
pub const fn ieee802154(&self) -> Option<Address>
The IEEE 802.15.4 address, or None if this is not one.
pub fn to_driver(&self) -> Option<HardwareAddress>
pub fn to_driver(&self) -> Option<HardwareAddress>
Convert to the address type drivers report, [crate::driver::HardwareAddress].
Returns None for an IEEE 802.15.4 address that is not an extended
address: drivers report extended addresses only.
pub fn from_driver(addr: HardwareAddress) -> Option<HardwareAddress>
pub fn from_driver(addr: HardwareAddress) -> Option<HardwareAddress>
Convert from the address type drivers report, [crate::driver::HardwareAddress].
Returns None if the build does not have the medium-* feature the
address kind belongs to.
Trait Implementations§
§impl Clone for HardwareAddress
impl Clone for HardwareAddress
§fn clone(&self) -> HardwareAddress
fn clone(&self) -> HardwareAddress
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for HardwareAddress
§impl Debug for HardwareAddress
impl Debug for HardwareAddress
§impl Display for HardwareAddress
impl Display for HardwareAddress
impl Eq for HardwareAddress
§impl Format for HardwareAddress
impl Format for HardwareAddress
§impl From<Address> for HardwareAddress
Available on crate feature medium-ieee802154 only.
impl From<Address> for HardwareAddress
medium-ieee802154 only.§fn from(addr: Address) -> HardwareAddress
fn from(addr: Address) -> HardwareAddress
§impl From<Address> for HardwareAddress
Available on crate feature medium-ethernet only.
impl From<Address> for HardwareAddress
medium-ethernet only.