Struct interfaces2::HardwareAddr[][src]

pub struct HardwareAddr(_);

HardwareAddr represents a hardware address (commonly known as a MAC address) of a given interface.

Methods

impl HardwareAddr
[src]

Returns a new, empty HardwareAddr structure. This is equivalent to the MAC address 00:00:00:00:00:00.

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");

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");

Important traits for &'a [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]

Formats the value using the given formatter. Read more

impl PartialEq for HardwareAddr
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for HardwareAddr
[src]

impl Clone for HardwareAddr
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for HardwareAddr
[src]

impl Hash for HardwareAddr
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Display for HardwareAddr
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations