Struct smoltcp::wire::EthernetAddress
source · [−]pub struct EthernetAddress(pub [u8; 6]);Expand description
A six-octet Ethernet II address.
Tuple Fields
0: [u8; 6]Implementations
sourceimpl 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 fn as_bytes(&self) -> &[u8]
pub 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 fn is_multicast(&self) -> bool
pub fn is_multicast(&self) -> bool
Query whether the “multicast” bit in the OUI is set.
Trait Implementations
sourceimpl From<Address> for HardwareAddress
impl From<Address> for HardwareAddress
sourcefn from(addr: EthernetAddress) -> Self
fn from(addr: EthernetAddress) -> Self
Converts to this type from the input type.
sourceimpl From<Address> for RawHardwareAddress
impl From<Address> for RawHardwareAddress
sourcefn from(addr: EthernetAddress) -> Self
fn from(addr: EthernetAddress) -> Self
Converts to this type from the input type.
sourceimpl FromStr for EthernetAddress
impl FromStr for EthernetAddress
sourcefn from_str(s: &str) -> Result<EthernetAddress, ()>
fn from_str(s: &str) -> Result<EthernetAddress, ()>
Parse a string representation of an Ethernet address.
type Err = ()
type Err = ()
The associated error which can be returned from parsing.
sourceimpl Hash for Address
impl Hash for Address
sourcefn hash<__H: Hasher>(&self, state: &mut __H)
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher]. Read more
1.3.0fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
sourceimpl Ord for Address
impl Ord for Address
sourceimpl PartialOrd<Address> for Address
impl PartialOrd<Address> for Address
sourcefn partial_cmp(&self, other: &Address) -> Option<Ordering>
fn partial_cmp(&self, other: &Address) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0fn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0fn 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
impl Copy for Address
impl Eq for Address
impl StructuralEq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more