pub enum Ieee802154Address {
Absent,
Short([u8; 2]),
Extended([u8; 8]),
}Expand description
An IEEE 802.15.4 address.
Variants§
Absent
No address.
Short([u8; 2])
A 16-bit short address.
Extended([u8; 8])
A 64-bit extended address.
Implementations§
Source§impl Address
impl Address
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 fn from_bytes(a: &[u8]) -> Self
pub fn from_bytes(a: &[u8]) -> Self
Construct an address from its bytes: 2 for a short address, 8 for an extended one.
§Panics
Panics if a is neither 2 nor 8 bytes long.
Sourcepub fn as_eui_64(&self) -> Option<[u8; 8]>
pub fn as_eui_64(&self) -> Option<[u8; 8]>
Convert an extended address to a modified EUI-64 interface identifier.
Returns None for short and absent addresses.
Sourcepub fn as_link_local_address(&self) -> Option<Ipv6Address>
pub fn as_link_local_address(&self) -> Option<Ipv6Address>
Convert an extended address to a link-local IPv6 address (RFC 4944 §6).
Returns None for short and absent addresses.
Trait Implementations§
impl Copy for Address
impl Eq for Address
Source§impl From<Address> for HardwareAddress
Available on crate feature medium-ieee802154 only.
impl From<Address> for HardwareAddress
Available on crate feature
medium-ieee802154 only.Source§fn from(addr: Ieee802154Address) -> Self
fn from(addr: Ieee802154Address) -> Self
Converts to this type from the input type.
Source§impl From<Address> for RawHardwareAddress
Available on crate feature medium-ieee802154 only.
impl From<Address> for RawHardwareAddress
Available on crate feature
medium-ieee802154 only.Source§fn from(addr: Ieee802154Address) -> Self
fn from(addr: Ieee802154Address) -> Self
Converts to this type from the input type.
Source§impl Ord for Address
impl Ord for Address
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Address
impl PartialOrd 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 UnsafeUnpin 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