pub struct MacAddr { /* private fields */ }
Expand description
MAC address for ethernet NIC.
Implementations§
Source§impl MacAddr
impl MacAddr
Sourcepub fn parse_str<S>(s: &S) -> Result<MacAddr, &str>
pub fn parse_str<S>(s: &S) -> Result<MacAddr, &str>
Parse a string into an MacAddr object. The error contains the str that failed to be parsed, for nicer error message generation.
Sourcepub fn from_bytes_unchecked(src: &[u8]) -> MacAddr
pub fn from_bytes_unchecked(src: &[u8]) -> MacAddr
Create a MacAddr object from raw bytes unchecked.
Does not check whether src.len() == MAC_ADDR_LEN.
Sourcepub fn from_bytes(src: &[u8]) -> Result<MacAddr, MacError>
pub fn from_bytes(src: &[u8]) -> Result<MacAddr, MacError>
Create a MacAddr object from raw bytes.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MacAddr
impl<'de> Deserialize<'de> for MacAddr
Source§fn deserialize<D>(deserializer: D) -> Result<MacAddr, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<MacAddr, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for MacAddr
impl Eq for MacAddr
impl StructuralPartialEq for MacAddr
Auto Trait Implementations§
impl Freeze for MacAddr
impl RefUnwindSafe for MacAddr
impl Send for MacAddr
impl Sync for MacAddr
impl Unpin for MacAddr
impl UnwindSafe for MacAddr
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