Struct interfaces::HardwareAddr
[−]
[src]
pub struct HardwareAddr(_);
HardwareAddr represents a hardware address (commonly known as a MAC address) of a given interface.
Methods
impl HardwareAddr
[src]
fn zero() -> HardwareAddr
[src]
Returns a new, empty HardwareAddr
structure. This is equivalent to the MAC address
00:00:00:00:00:00
.
fn as_string(&self) -> String
[src]
Formats this hardware address in the standard MAC address format - 6 octets in hexadecimal format, each seperated by a colon.
let s = HardwareAddr::zero().as_string(); assert_eq!(s, "00:00:00:00:00:00");
fn as_bare_string(&self) -> String
[src]
Formats this hardware address as a sequence of hexadecimal numbers without the seperating colons.
let s = HardwareAddr::zero().as_bare_string(); assert_eq!(s, "000000000000");
fn as_bytes(&self) -> &[u8]
[src]
Returns the raw bytes representing this hardware address.
let s = HardwareAddr::zero(); assert_eq!(s.as_bytes(), &[0, 0, 0, 0, 0, 0]);
Trait Implementations
impl Debug for HardwareAddr
[src]
impl PartialEq for HardwareAddr
[src]
fn eq(&self, __arg_0: &HardwareAddr) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &HardwareAddr) -> bool
[src]
This method tests for !=
.
impl Eq for HardwareAddr
[src]
impl Clone for HardwareAddr
[src]
fn clone(&self) -> HardwareAddr
[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 Copy for HardwareAddr
[src]
impl Hash for HardwareAddr
[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