[−][src]Struct pnet_base::MacAddr
A MAC address
Methods
impl MacAddr
[src]
pub fn new(a: u8, b: u8, c: u8, d: u8, e: u8, f: u8) -> MacAddr
[src]
Construct a new MacAddr
pub fn zero() -> MacAddr
[src]
Construct an all-zero MacAddr
pub fn broadcast() -> MacAddr
[src]
Construct a broadcast MacAddr
pub fn is_zero(&self) -> bool
[src]
Returns true if the MacAddr is an all-zero address
pub fn is_universal(&self) -> bool
[src]
Returns true if the MacAddr is a universally administered addresses (UAA)
pub fn is_local(&self) -> bool
[src]
Returns true if the MacAddr is a locally administered addresses (LAA)
pub fn is_unicast(&self) -> bool
[src]
Returns true if the MacAddr is a unicast address
pub fn is_multicast(&self) -> bool
[src]
Returns true if the MacAddr is a multicast address
pub fn is_broadcast(&self) -> bool
[src]
Returns true if the MacAddr is a broadcast address
Trait Implementations
impl PartialEq<MacAddr> for MacAddr
[src]
impl PartialEq<[u8; 6]> for MacAddr
[src]
fn eq(&self, other: &[u8; 6]) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Clone for MacAddr
[src]
fn clone(&self) -> MacAddr
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialOrd<MacAddr> for MacAddr
[src]
fn partial_cmp(&self, other: &MacAddr) -> Option<Ordering>
[src]
fn lt(&self, other: &MacAddr) -> bool
[src]
fn le(&self, other: &MacAddr) -> bool
[src]
fn gt(&self, other: &MacAddr) -> bool
[src]
fn ge(&self, other: &MacAddr) -> bool
[src]
impl Eq for MacAddr
[src]
impl Ord for MacAddr
[src]
fn cmp(&self, other: &MacAddr) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl From<[u8; 6]> for MacAddr
[src]
impl From<MacAddr> for [u8; 6]
[src]
impl Default for MacAddr
[src]
impl Copy for MacAddr
[src]
impl Display for MacAddr
[src]
impl Debug for MacAddr
[src]
impl Hash for MacAddr
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl FromStr for MacAddr
[src]
type Err = ParseMacAddrErr
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<MacAddr, ParseMacAddrErr>
[src]
impl Serialize for MacAddr
[src]
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>
[src]
Serializes the MAC address.
It serializes either to a string or its binary representation, depending on what the format prefers.
impl<'de> Deserialize<'de> for MacAddr
[src]
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
[src]
Deserializes the MAC address.
It deserializes it from either a byte array (of size 6) or a string. If the format is self-descriptive (like JSON or MessagePack), it auto-detects it. If not, it obeys the human-readable property of the deserializer.
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,