Struct smoltcp::wire::Ipv6Address
source · Expand description
A sixteen-octet IPv6 address.
Tuple Fields§
§0: [u8; 16]
Implementations§
source§impl Address
impl Address
sourcepub const UNSPECIFIED: Address = _
pub const UNSPECIFIED: Address = _
The unspecified address.
sourcepub const LINK_LOCAL_ALL_NODES: Address = _
pub const LINK_LOCAL_ALL_NODES: Address = _
The link-local all routers multicast address.
sourcepub const LINK_LOCAL_ALL_ROUTERS: Address = _
pub const LINK_LOCAL_ALL_ROUTERS: Address = _
The link-local all nodes multicast address.
sourcepub const LOOPBACK: Address = _
pub const LOOPBACK: Address = _
The loopback address.
sourcepub fn new(
a0: u16,
a1: u16,
a2: u16,
a3: u16,
a4: u16,
a5: u16,
a6: u16,
a7: u16
) -> Address
pub 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 fn as_bytes(&self) -> &[u8] ⓘ
pub 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 fn is_multicast(&self) -> bool
pub 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.
Trait Implementations§
source§impl From<Address> for Address
impl From<Address> for Address
source§fn from(addr: Ipv6Address) -> Self
fn from(addr: Ipv6Address) -> Self
source§impl FromStr for Ipv6Address
impl FromStr for Ipv6Address
source§impl Ord for Address
impl Ord 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