Struct eui48::MacAddress
[−]
[src]
pub struct MacAddress { // some fields omitted }
A MAC address (EUI-48)
Methods
impl MacAddress
[src]
fn new(eui: Eui48) -> MacAddress
Create a new MacAddress from vec![u8; 6]
fn nil() -> MacAddress
Returns empty EUI-48 address
fn broadcast() -> MacAddress
Returns 'ff:ff:ff:ff:ff:ff', a MAC broadcast address
fn is_nil(&self) -> bool
Returns true if the address is '00:00:00:00:00:00'
fn is_broadcast(&self) -> bool
Returns true if the address is 'ff:ff:ff:ff:ff:ff'
fn is_unicast(&self) -> bool
Returns true if bit 1 of Y is 1 in address 'xY:xx:xx:xx:xx:xx'
fn is_multicast(&self) -> bool
Returns true if bit 1 of Y is 1 in address 'xY:xx:xx:xx:xx:xx'
fn is_universal(&self) -> bool
Returns true if bit 2 of Y is 0 in address 'xY:xx:xx:xx:xx:xx'
fn is_local(&self) -> bool
Returns true if bit 2 of Y is 1 in address 'xY:xx:xx:xx:xx:xx'
fn to_canonical(&self) -> String
Returns a String representation in the format '00-00-00-00-00-00'
fn to_hex_string(&self) -> String
Returns a String representation in the format '00:00:00:00:00:00'
fn to_dot_string(&self) -> String
Returns a String representation in the format '0000.0000.0000'
fn to_hexadecimal(&self) -> String
Returns a String representation in the format '0x000000000000'
fn to_string(&self, fmt: MacAddressFormat) -> String
Returns a String in the format selected by fmt
fn parse_str(s: &str) -> Result<MacAddress, ParseError>
Parses a String representation from any format supported
fn as_bytes<'a>(&'a self) -> &'a [u8]
Return the internal structure as a slice of bytes
Trait Implementations
impl Clone for MacAddress
[src]
fn clone(&self) -> MacAddress
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy 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>
Create a MacAddress from String
impl Default for MacAddress
[src]
fn default() -> MacAddress
Create a Default MacAddress (00-00-00-00-00-00)
impl Debug for MacAddress
[src]
impl Display for MacAddress
[src]
impl PartialEq for MacAddress
[src]
fn eq(&self, other: &MacAddress) -> bool
Define PartialEq as eui equal
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl Eq for MacAddress
[src]
impl Encodable for MacAddress
[src]
fn encode<E: Encoder>(&self, e: &mut E) -> Result<(), E::Error>
Encode a MacAddress as canonical form
impl Decodable for MacAddress
[src]
fn decode<D: Decoder>(d: &mut D) -> Result<MacAddress, D::Error>
Decode a MacAddress from a string in canonical form