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]
impl HardwareAddr
pub fn zero() -> HardwareAddr
[src]
pub fn zero() -> HardwareAddr
Returns a new, empty HardwareAddr
structure. This is equivalent to the MAC address
00:00:00:00:00:00
.
pub fn as_string(&self) -> String
[src]
pub fn as_string(&self) -> String
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");
pub fn as_bare_string(&self) -> String
[src]
pub fn as_bare_string(&self) -> String
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");
pub fn as_bytes(&self) -> &[u8]
[src]
pub fn as_bytes(&self) -> &[u8]
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 Debug for HardwareAddr
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for HardwareAddr
[src]
impl PartialEq for HardwareAddr
fn eq(&self, other: &HardwareAddr) -> bool
[src]
fn eq(&self, other: &HardwareAddr) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &HardwareAddr) -> bool
[src]
fn ne(&self, other: &HardwareAddr) -> bool
This method tests for !=
.
impl Eq for HardwareAddr
[src]
impl Eq for HardwareAddr
impl Clone for HardwareAddr
[src]
impl Clone for HardwareAddr
fn clone(&self) -> HardwareAddr
[src]
fn clone(&self) -> HardwareAddr
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for HardwareAddr
[src]
impl Copy for HardwareAddr
impl Hash for HardwareAddr
[src]
impl Hash for HardwareAddr
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Display for HardwareAddr
[src]
impl Display for HardwareAddr
Auto Trait Implementations
impl Send for HardwareAddr
impl Send for HardwareAddr
impl Sync for HardwareAddr
impl Sync for HardwareAddr