Struct w5500::net::MacAddress
source · Expand description
MAC address struct. Can be instantiated with MacAddress::new
.
This is an EUI-48 MAC address (previously called MAC-48).
Fields§
§octets: [u8; 6]
Octets of the MAC address.
Implementations§
source§impl MacAddress
impl MacAddress
sourcepub const fn new(a: u8, b: u8, c: u8, d: u8, e: u8, f: u8) -> MacAddress
pub const fn new(a: u8, b: u8, c: u8, d: u8, e: u8, f: u8) -> MacAddress
Creates a new EUI-48 MAC address from six eight-bit octets.
The result will represent the EUI-48 MAC address
a
:b
:c
:d
:e
:f
.
Examples
use w5500::MacAddress;
let addr = MacAddress::new(0x00, 0x00, 0x5E, 0x00, 0x00, 0x00);
sourcepub const fn octets(&self) -> [u8; 6]
pub const fn octets(&self) -> [u8; 6]
Returns the six eight-bit integers that make up this address.
Examples
use w5500::MacAddress;
let addr = MacAddress::new(13, 12, 11, 10, 15, 14);
assert_eq!([13u8, 12u8, 11u8, 10u8, 15u8, 14u8], addr.octets());
sourcepub const UNSPECIFIED: Self = _
pub const UNSPECIFIED: Self = _
An EUI-48 MAC address representing an unspecified address: 00:00:00:00:00:00
Examples
use w5500::MacAddress;
let addr = MacAddress::UNSPECIFIED;
assert_eq!(addr, MacAddress::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00));
Trait Implementations§
source§impl Clone for MacAddress
impl Clone for MacAddress
source§fn clone(&self) -> MacAddress
fn clone(&self) -> MacAddress
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MacAddress
impl Debug for MacAddress
source§impl Default for MacAddress
impl Default for MacAddress
source§fn default() -> MacAddress
fn default() -> MacAddress
Returns the “default value” for a type. Read more
source§impl Display for MacAddress
impl Display for MacAddress
source§impl Hash for MacAddress
impl Hash for MacAddress
source§impl Ord for MacAddress
impl Ord for MacAddress
source§fn cmp(&self, other: &MacAddress) -> Ordering
fn cmp(&self, other: &MacAddress) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<MacAddress> for MacAddress
impl PartialEq<MacAddress> for MacAddress
source§fn eq(&self, other: &MacAddress) -> bool
fn eq(&self, other: &MacAddress) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<MacAddress> for MacAddress
impl PartialOrd<MacAddress> for MacAddress
source§fn partial_cmp(&self, other: &MacAddress) -> Option<Ordering>
fn partial_cmp(&self, other: &MacAddress) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more