Struct eui48::MacAddress
[−]
[src]
pub struct MacAddress { /* fields omitted */ }
A MAC address (EUI-48)
Methods
impl MacAddress
[src]
fn new(eui: Eui48) -> MacAddress
[src]
Create a new MacAddress from [u8; 6]
.
fn from_bytes(bytes: &[u8]) -> Result<Self, ()>
[src]
Create a new MacAddress from a byte slice.
Returns an error (without any description) if the slice doesn't have the proper length.
fn nil() -> MacAddress
[src]
Returns empty EUI-48 address
fn broadcast() -> MacAddress
[src]
Returns 'ff:ff:ff:ff:ff:ff', a MAC broadcast address
fn is_nil(&self) -> bool
[src]
Returns true if the address is '00:00:00:00:00:00'
fn is_broadcast(&self) -> bool
[src]
Returns true if the address is 'ff:ff:ff:ff:ff:ff'
fn is_unicast(&self) -> bool
[src]
Returns true if bit 1 of Y is 1 in address 'xY:xx:xx:xx:xx:xx'
fn is_multicast(&self) -> bool
[src]
Returns true if bit 1 of Y is 1 in address 'xY:xx:xx:xx:xx:xx'
fn is_universal(&self) -> bool
[src]
Returns true if bit 2 of Y is 0 in address 'xY:xx:xx:xx:xx:xx'
fn is_local(&self) -> bool
[src]
Returns true if bit 2 of Y is 1 in address 'xY:xx:xx:xx:xx:xx'
fn to_canonical(&self) -> String
[src]
Returns a String representation in the format '00-00-00-00-00-00'
fn to_hex_string(&self) -> String
[src]
Returns a String representation in the format '00:00:00:00:00:00'
fn to_dot_string(&self) -> String
[src]
Returns a String representation in the format '0000.0000.0000'
fn to_hexadecimal(&self) -> String
[src]
Returns a String representation in the format '0x000000000000'
fn to_string(&self, fmt: MacAddressFormat) -> String
[src]
Returns a String in the format selected by fmt
fn parse_str(s: &str) -> Result<MacAddress, ParseError>
[src]
Parses a String representation from any format supported
fn as_bytes<'a>(&'a self) -> &'a [u8]
[src]
Return the internal structure as a slice of bytes
Trait Implementations
impl Copy for MacAddress
[src]
impl Clone for MacAddress
[src]
fn clone(&self) -> MacAddress
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Hash for MacAddress
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
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 Eq for MacAddress
[src]
impl PartialEq for MacAddress
[src]
fn eq(&self, __arg_0: &MacAddress) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &MacAddress) -> bool
[src]
This method tests for !=
.
impl Ord for MacAddress
[src]
fn cmp(&self, __arg_0: &MacAddress) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl PartialOrd for MacAddress
[src]
fn partial_cmp(&self, __arg_0: &MacAddress) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &MacAddress) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &MacAddress) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &MacAddress) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &MacAddress) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
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 Default for MacAddress
[src]
fn default() -> MacAddress
[src]
Create a Default MacAddress (00-00-00-00-00-00)
impl Debug for MacAddress
[src]
impl Display for MacAddress
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Display format is canonical format (00-00-00-00-00-00)
impl Encodable for MacAddress
[src]
fn encode<E: Encoder>(&self, e: &mut E) -> Result<(), E::Error>
[src]
Encode a MacAddress as canonical form