pub struct RawHardwareAddress { /* private fields */ }Expand description
Unparsed hardware address.
Used to make NDISC parsing agnostic of the hardware medium in use.
Implementations§
Source§impl RawHardwareAddress
impl RawHardwareAddress
Sourcepub fn from_bytes(addr: &[u8]) -> Self
pub fn from_bytes(addr: &[u8]) -> Self
Create a new RawHardwareAddress from a byte slice.
§Panics
Panics if addr.len() > MAX_HARDWARE_ADDRESS_LEN.
pub fn as_bytes(&self) -> &[u8] ⓘ
pub const fn len(&self) -> usize
pub const fn is_empty(&self) -> bool
Sourcepub fn parse(&self, medium: Medium) -> Result<HardwareAddress>
pub fn parse(&self, medium: Medium) -> Result<HardwareAddress>
Parse the address as an address of the given medium.
Errors:
Errorif the length is wrong for the medium: 6 bytes for Ethernet, 8 (an extended address) for IEEE 802.15.4, or if the medium has no addresses.
Trait Implementations§
Source§impl Clone for RawHardwareAddress
impl Clone for RawHardwareAddress
Source§fn clone(&self) -> RawHardwareAddress
fn clone(&self) -> RawHardwareAddress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RawHardwareAddress
Source§impl Debug for RawHardwareAddress
impl Debug for RawHardwareAddress
Source§impl Display for RawHardwareAddress
impl Display for RawHardwareAddress
impl Eq for RawHardwareAddress
Source§impl From<Address> for RawHardwareAddress
Available on crate feature medium-ethernet only.
impl From<Address> for RawHardwareAddress
Available on crate feature
medium-ethernet only.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
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 From<HardwareAddress> for RawHardwareAddress
impl From<HardwareAddress> for RawHardwareAddress
Source§fn from(addr: HardwareAddress) -> Self
fn from(addr: HardwareAddress) -> Self
Converts to this type from the input type.
Source§impl PartialEq for RawHardwareAddress
impl PartialEq for RawHardwareAddress
impl StructuralPartialEq for RawHardwareAddress
Auto Trait Implementations§
impl Freeze for RawHardwareAddress
impl RefUnwindSafe for RawHardwareAddress
impl Send for RawHardwareAddress
impl Sync for RawHardwareAddress
impl Unpin for RawHardwareAddress
impl UnsafeUnpin for RawHardwareAddress
impl UnwindSafe for RawHardwareAddress
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