[−][src]Struct heim_net::MacAddr6
MAC address in EUI-48 format.
Implementations
impl MacAddr6
[src]
pub const fn new(a: u8, b: u8, c: u8, d: u8, e: u8, f: u8) -> MacAddr6
[src]
Creates a new MacAddr6
address from the bytes.
Example
let addr = MacAddr6::new(0x01, 0x23, 0x45, 0x67, 0x89, 0xAB);
pub const fn nil() -> MacAddr6
[src]
pub const fn broadcast() -> MacAddr6
[src]
Create a new broadcast MacAddr6
.
Example
let addr = MacAddr6::broadcast(); assert!(addr.is_broadcast());
pub fn is_nil(&self) -> bool
[src]
Returns true
if the address is nil.
Example
let addr = MacAddr6::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00); assert_eq!(addr.is_nil(), true);
pub fn is_broadcast(&self) -> bool
[src]
Returns true
if the address is broadcast.
Example
let addr = MacAddr6::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); assert_eq!(addr.is_broadcast(), true);
pub const fn is_unicast(&self) -> bool
[src]
Returns true
if the address is unicast.
Example
let addr = MacAddr6::new(0x00, 0x01, 0x44, 0x55, 0x66, 0x77); assert_eq!(addr.is_unicast(), true);
pub const fn is_multicast(&self) -> bool
[src]
Returns true
if the address is multicast.
Example
let addr = MacAddr6::new(0x01, 0x00, 0x0C, 0xCC, 0xCC, 0xCC); assert_eq!(addr.is_multicast(), true);
pub const fn is_universal(&self) -> bool
[src]
Returns true
if the address is universally administered address (UAA).
Example
let addr = MacAddr6::new(0x01, 0x00, 0x0C, 0xCC, 0xCC, 0xCC); assert_eq!(addr.is_universal(), true);
pub const fn is_local(&self) -> bool
[src]
Returns true
if the address is locally administered (LAA).
Example
let addr = MacAddr6::new(0x02, 0x00, 0x0C, 0xCC, 0xCC, 0xCC); assert_eq!(addr.is_local(), true);
pub fn as_bytes(&self) -> &[u8]
[src]
Converts a MacAddr6
address to a byte slice.
Example
let addr = MacAddr6::new(0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67); assert_eq!(addr.as_bytes(), &[0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67]);
pub const fn into_array(self) -> [u8; 6]
[src]
Consumes MacAddr6
address and returns raw bytes array.
Example
let addr = MacAddr6::new(0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67); assert_eq!(addr.into_array(), [0xAC, 0xDE, 0x48, 0x23, 0x45, 0x67]);
Trait Implementations
impl AsMut<[u8]> for MacAddr6
[src]
impl AsRef<[u8]> for MacAddr6
[src]
impl Clone for MacAddr6
[src]
impl Copy for MacAddr6
[src]
impl Debug for MacAddr6
[src]
impl Default for MacAddr6
[src]
impl Display for MacAddr6
[src]
MacAddr6
can be displayed in different formats.
Example
let addr = MacAddr6::new(0xab, 0x0d, 0xef, 0x12, 0x34, 0x56); assert_eq!(&format!("{}", addr), "AB:0D:EF:12:34:56"); assert_eq!(&format!("{:-}", addr), "AB-0D-EF-12-34-56"); assert_eq!(&format!("{:#}", addr), "AB0.DEF.123.456");
impl Eq for MacAddr6
[src]
impl From<[u8; 6]> for MacAddr6
[src]
impl From<MacAddr6> for MacAddr
[src]
impl FromStr for MacAddr6
[src]
type Err = ParseError
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<MacAddr6, <MacAddr6 as FromStr>::Err>
[src]
impl Hash for MacAddr6
[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 MacAddr6
[src]
pub fn cmp(&self, other: &MacAddr6) -> 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<MacAddr6> for MacAddr6
[src]
impl PartialOrd<MacAddr6> for MacAddr6
[src]
pub fn partial_cmp(&self, other: &MacAddr6) -> Option<Ordering>
[src]
pub fn lt(&self, other: &MacAddr6) -> bool
[src]
pub fn le(&self, other: &MacAddr6) -> bool
[src]
pub fn gt(&self, other: &MacAddr6) -> bool
[src]
pub fn ge(&self, other: &MacAddr6) -> bool
[src]
impl StructuralEq for MacAddr6
[src]
impl StructuralPartialEq for MacAddr6
[src]
Auto Trait Implementations
impl RefUnwindSafe for MacAddr6
[src]
impl Send for MacAddr6
[src]
impl Sync for MacAddr6
[src]
impl Unpin for MacAddr6
[src]
impl UnwindSafe for MacAddr6
[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>,