Struct embassy_net::Ipv6Address
source · pub struct Ipv6Address(pub [u8; 16]);
Expand description
A sixteen-octet IPv6 address.
Tuple Fields§
§0: [u8; 16]
Implementations§
source§impl Address
impl Address
sourcepub const UNSPECIFIED: Address = Address([0; ADDR_SIZE])
pub const UNSPECIFIED: Address = Address([0; ADDR_SIZE])
The unspecified address.
sourcepub const LINK_LOCAL_ALL_NODES: Address = Address([255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1])
pub const LINK_LOCAL_ALL_NODES: Address = Address([255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1])
The link-local all nodes multicast address.
sourcepub const LINK_LOCAL_ALL_ROUTERS: Address = Address([255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2])
pub const LINK_LOCAL_ALL_ROUTERS: Address = Address([255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2])
The link-local all routers multicast address.
sourcepub const LOOPBACK: Address = Address([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1])
pub const LOOPBACK: Address = Address([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1])
The loopback address.
sourcepub const IPV4_MAPPED_PREFIX: [u8; 12] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255]
pub const IPV4_MAPPED_PREFIX: [u8; 12] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255]
The prefix used in IPv4-mapped addresses.
sourcepub const fn new(
a0: u16,
a1: u16,
a2: u16,
a3: u16,
a4: u16,
a5: u16,
a6: u16,
a7: u16
) -> Address
pub const fn new(
a0: u16,
a1: u16,
a2: u16,
a3: u16,
a4: u16,
a5: u16,
a6: u16,
a7: u16
) -> Address
Construct an IPv6 address from parts.
sourcepub fn from_bytes(data: &[u8]) -> Address
pub fn from_bytes(data: &[u8]) -> Address
Construct an IPv6 address from a sequence of octets, in big-endian.
Panics
The function panics if data
is not sixteen octets long.
sourcepub fn from_parts(data: &[u16]) -> Address
pub fn from_parts(data: &[u16]) -> Address
Construct an IPv6 address from a sequence of words, in big-endian.
Panics
The function panics if data
is not 8 words long.
sourcepub fn write_parts(&self, data: &mut [u16])
pub fn write_parts(&self, data: &mut [u16])
sourcepub const fn as_bytes(&self) -> &[u8]
pub const fn as_bytes(&self) -> &[u8]
Return an IPv6 address as a sequence of octets, in big-endian.
sourcepub fn is_unicast(&self) -> bool
pub fn is_unicast(&self) -> bool
Query whether the IPv6 address is an unicast address.
sourcepub const fn is_multicast(&self) -> bool
pub const fn is_multicast(&self) -> bool
Query whether the IPv6 address is a multicast address.
sourcepub fn is_unspecified(&self) -> bool
pub fn is_unspecified(&self) -> bool
Query whether the IPv6 address is the unspecified address.
sourcepub fn is_link_local(&self) -> bool
pub fn is_link_local(&self) -> bool
Query whether the IPv6 address is in the link-local scope.
sourcepub fn is_loopback(&self) -> bool
pub fn is_loopback(&self) -> bool
Query whether the IPv6 address is the loopback address.
sourcepub fn is_ipv4_mapped(&self) -> bool
pub fn is_ipv4_mapped(&self) -> bool
Query whether the IPv6 address is an IPv4 mapped IPv6 address.
sourcepub fn as_ipv4(&self) -> Option<Address>
pub fn as_ipv4(&self) -> Option<Address>
Convert an IPv4 mapped IPv6 address to an IPv4 address.
sourcepub fn solicited_node(&self) -> Address
pub fn solicited_node(&self) -> Address
The solicited node for the given unicast address.
Panics
This function panics if the given address is not unicast.
sourcepub const fn into_address(self) -> Address
pub const fn into_address(self) -> Address
Convert to an IpAddress
.
Same as .into()
, but works in const
.
Trait Implementations§
source§impl Ord for Address
impl Ord for Address
source§impl PartialEq<Address> for Address
impl PartialEq<Address> for Address
source§impl PartialOrd<Address> for Address
impl PartialOrd<Address> for Address
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more