[−][src]Enum heim_net::MacAddr
A MAC address, either in EUI-48 or EUI-64 format.
Variants
V6(MacAddr6)
V8(MacAddr8)
Implementations
impl MacAddr
[src]
pub fn is_v6(&self) -> bool
[src]
Returns true
if the address is MacAddr6
address.
Example
let addr = MacAddr::from([0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67]); assert_eq!(addr.is_v6(), true); assert_eq!(addr.is_v8(), false);
pub fn is_v8(&self) -> bool
[src]
Returns true
if the address is MacAddr8
address.
Example
let addr = MacAddr::from([0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67, 0x89, 0xAB]); assert_eq!(addr.is_v6(), false); assert_eq!(addr.is_v8(), true);
pub fn as_bytes(&self) -> &[u8]
[src]
Converts a MacAddr
address to a byte slice.
Length of the returned slice is depends on the enum member used.
Example
let addr = MacAddr::from([0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67]); assert_eq!(addr.as_bytes(), &[0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67]);
Trait Implementations
impl Clone for MacAddr
[src]
impl Copy for MacAddr
[src]
impl Debug for MacAddr
[src]
impl Display for MacAddr
[src]
impl Eq for MacAddr
[src]
impl From<[u8; 6]> for MacAddr
[src]
impl From<[u8; 8]> for MacAddr
[src]
impl From<MacAddr6> for MacAddr
[src]
impl From<MacAddr8> for MacAddr
[src]
impl FromStr for MacAddr
[src]
type Err = ParseError
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<MacAddr, <MacAddr as FromStr>::Err>
[src]
impl Hash for MacAddr
[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for MacAddr
[src]
pub fn cmp(&self, other: &MacAddr) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<MacAddr> for MacAddr
[src]
impl PartialOrd<MacAddr> for MacAddr
[src]
pub fn partial_cmp(&self, other: &MacAddr) -> Option<Ordering>
[src]
pub fn lt(&self, other: &MacAddr) -> bool
[src]
pub fn le(&self, other: &MacAddr) -> bool
[src]
pub fn gt(&self, other: &MacAddr) -> bool
[src]
pub fn ge(&self, other: &MacAddr) -> bool
[src]
impl StructuralEq for MacAddr
[src]
impl StructuralPartialEq for MacAddr
[src]
Auto Trait Implementations
impl RefUnwindSafe for MacAddr
[src]
impl Send for MacAddr
[src]
impl Sync for MacAddr
[src]
impl Unpin for MacAddr
[src]
impl UnwindSafe for MacAddr
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,