Struct netsim::wire::MacAddr [−][src]
pub struct MacAddr { /* fields omitted */ }
An ethernet hardware MAC address.
Methods
impl MacAddr
[src]
impl MacAddr
pub const BROADCAST: MacAddr
BROADCAST: MacAddr = MacAddr{bytes: [255, 255, 255, 255, 255, 255],}
The broadcast ethernet address.
pub fn from_bytes(bytes: &[u8]) -> MacAddr
[src]
pub fn from_bytes(bytes: &[u8]) -> MacAddr
Create a MacAddr
from the given 6-byte buffer.
pub fn as_bytes(&self) -> &[u8]
[src]
pub fn as_bytes(&self) -> &[u8]
Get the address as a slice of bytes.
pub fn random() -> MacAddr
[src]
pub fn random() -> MacAddr
Generate a random MAC address.
pub fn is_broadcast(&self) -> bool
[src]
pub fn is_broadcast(&self) -> bool
Checks weather this is the broadcast address.
Trait Implementations
impl Clone for MacAddr
[src]
impl Clone for MacAddr
fn clone(&self) -> MacAddr
[src]
fn clone(&self) -> MacAddr
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)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for MacAddr
[src]
impl Copy for MacAddr
impl PartialEq for MacAddr
[src]
impl PartialEq for MacAddr
fn eq(&self, other: &MacAddr) -> bool
[src]
fn eq(&self, other: &MacAddr) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &MacAddr) -> bool
[src]
fn ne(&self, other: &MacAddr) -> bool
This method tests for !=
.
impl Debug for MacAddr
[src]
impl Debug for MacAddr
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 Display for MacAddr
[src]
impl Display for MacAddr