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 HardwareAddrpub fn zero() -> HardwareAddr[src]
pub fn zero() -> HardwareAddrReturns 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) -> StringFormats 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) -> StringFormats 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 HardwareAddrfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl PartialEq for HardwareAddr[src]
impl PartialEq for HardwareAddrfn eq(&self, other: &HardwareAddr) -> bool[src]
fn eq(&self, other: &HardwareAddr) -> boolThis 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) -> boolThis method tests for !=.
impl Eq for HardwareAddr[src]
impl Eq for HardwareAddrimpl Clone for HardwareAddr[src]
impl Clone for HardwareAddrfn clone(&self) -> HardwareAddr[src]
fn clone(&self) -> HardwareAddrReturns 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 HardwareAddrimpl Hash for HardwareAddr[src]
impl Hash for HardwareAddrfn 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 HardwareAddrAuto Trait Implementations
impl Send for HardwareAddr
impl Send for HardwareAddrimpl Sync for HardwareAddr
impl Sync for HardwareAddr