[−][src]Struct eui48::MacAddress
A MAC address (EUI-48)
Implementations
impl MacAddress
[src]
pub const fn new(eui: Eui48) -> MacAddress
[src]
Create a new MacAddress from [u8; 6]
.
pub fn from_bytes(bytes: &[u8]) -> Result<Self, ParseError>
[src]
Create a new MacAddress from a byte slice.
Returns an error (without any description) if the slice doesn't have the proper length.
pub fn nil() -> MacAddress
[src]
Returns empty EUI-48 address
pub fn broadcast() -> MacAddress
[src]
Returns 'ff:ff:ff:ff:ff:ff', a MAC broadcast address
pub fn is_nil(&self) -> bool
[src]
Returns true if the address is '00:00:00:00:00:00'
pub fn is_broadcast(&self) -> bool
[src]
Returns true if the address is 'ff:ff:ff:ff:ff:ff'
pub fn is_unicast(&self) -> bool
[src]
Returns true if bit 1 of Y is 0 in address 'xY:xx:xx:xx:xx:xx'
pub fn is_multicast(&self) -> bool
[src]
Returns true if bit 1 of Y is 1 in address 'xY:xx:xx:xx:xx:xx'
pub fn is_universal(&self) -> bool
[src]
Returns true if bit 2 of Y is 0 in address 'xY:xx:xx:xx:xx:xx'
pub fn is_local(&self) -> bool
[src]
Returns true if bit 2 of Y is 1 in address 'xY:xx:xx:xx:xx:xx'
pub fn to_canonical(&self) -> String
[src]
Returns a String representation in the format '00-00-00-00-00-00'
pub fn to_hex_string(&self) -> String
[src]
Returns a String representation in the format '00:00:00:00:00:00'
pub fn to_dot_string(&self) -> String
[src]
Returns a String representation in the format '0000.0000.0000'
pub fn to_hexadecimal(&self) -> String
[src]
Returns a String representation in the format '0x000000000000'
pub fn to_interfaceid(&self) -> String
[src]
Returns a String representation in the EUI-64 interface ID format '0000:00ff:fe00:0000'
pub fn to_link_local(&self) -> String
[src]
Returns a String representation in the IPv6 link local format 'fe80::0000:00ff:fe00:0000'
pub fn to_string(&self, fmt: MacAddressFormat) -> String
[src]
Returns a String in the format selected by fmt
pub fn parse_str(s: &str) -> Result<MacAddress, ParseError>
[src]
Parses a String representation from any format supported
pub fn as_bytes(&self) -> &[u8]
[src]
Return the internal structure as a slice of bytes
pub fn to_array(&self) -> Eui48
[src]
Returns an array in Eui48. Works as an inverse function of new()
pub fn get_display_format() -> MacAddressFormat
[src]
Returns Display MacAddressFormat, determined at compile time.
Trait Implementations
impl Clone for MacAddress
[src]
fn clone(&self) -> MacAddress
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for MacAddress
[src]
impl Debug for MacAddress
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
Debug format for MacAddress is HexString notation
impl Decodable for MacAddress
[src]
fn decode<D: Decoder>(d: &mut D) -> Result<MacAddress, D::Error>
[src]
Decode a MacAddress from a string in canonical form
impl Default for MacAddress
[src]
fn default() -> MacAddress
[src]
Create a Default MacAddress (00-00-00-00-00-00)
impl<'de> Deserialize<'de> for MacAddress
[src]
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
[src]
Deserialize a MacAddress from canonical form using the serde crate
impl Display for MacAddress
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
Display format is canonical format (00-00-00-00-00-00) by default
impl Encodable for MacAddress
[src]
fn encode<E: Encoder>(&self, e: &mut E) -> Result<(), E::Error>
[src]
Encode a MacAddress using the default format
impl Eq for MacAddress
[src]
impl FromStr for MacAddress
[src]
type Err = ParseError
The associated error which can be returned from parsing.
fn from_str(us: &str) -> Result<MacAddress, ParseError>
[src]
Create a MacAddress from String
impl Hash for MacAddress
[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,
impl Ord for MacAddress
[src]
fn cmp(&self, other: &MacAddress) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<MacAddress> for MacAddress
[src]
fn eq(&self, other: &MacAddress) -> bool
[src]
fn ne(&self, other: &MacAddress) -> bool
[src]
impl PartialOrd<MacAddress> for MacAddress
[src]
fn partial_cmp(&self, other: &MacAddress) -> Option<Ordering>
[src]
fn lt(&self, other: &MacAddress) -> bool
[src]
fn le(&self, other: &MacAddress) -> bool
[src]
fn gt(&self, other: &MacAddress) -> bool
[src]
fn ge(&self, other: &MacAddress) -> bool
[src]
impl Serialize for MacAddress
[src]
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>
[src]
Serialize a MacAddress in the default format using the serde crate
impl StructuralEq for MacAddress
[src]
impl StructuralPartialEq for MacAddress
[src]
Auto Trait Implementations
impl RefUnwindSafe for MacAddress
impl Send for MacAddress
impl Sync for MacAddress
impl Unpin for MacAddress
impl UnwindSafe for MacAddress
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,