Struct net::wire::Ipv6Address
pub struct Ipv6Address(pub [u8; 16]);
Expand description
A sixteen-octet IPv6 address.
Tuple Fields§
§0: [u8; 16]
Implementations§
§impl Address
impl Address
pub const UNSPECIFIED: Address = _
pub const UNSPECIFIED: Address = _
The unspecified address.
pub const LINK_LOCAL_ALL_NODES: Address = _
pub const LINK_LOCAL_ALL_NODES: Address = _
The link-local all nodes multicast address.
pub const LINK_LOCAL_ALL_ROUTERS: Address = _
pub const LINK_LOCAL_ALL_ROUTERS: Address = _
The link-local all routers multicast address.
pub const LOOPBACK: Address = _
pub const LOOPBACK: Address = _
The loopback address.
pub const IPV4_MAPPED_PREFIX: [u8; 12] = _
pub const IPV4_MAPPED_PREFIX: [u8; 12] = _
The prefix used in IPv4-mapped addresses.
pub 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.
pub 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.
pub 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.
pub fn write_parts(&self, data: &mut [u16])
pub fn write_parts(&self, data: &mut [u16])
pub fn is_unicast(&self) -> bool
pub fn is_unicast(&self) -> bool
Query whether the IPv6 address is an unicast address.
pub const fn is_multicast(&self) -> bool
pub const fn is_multicast(&self) -> bool
Query whether the IPv6 address is a multicast address.
pub fn is_unspecified(&self) -> bool
pub fn is_unspecified(&self) -> bool
Query whether the IPv6 address is the unspecified address.
pub fn is_link_local(&self) -> bool
pub fn is_link_local(&self) -> bool
Query whether the IPv6 address is in the link-local scope.
pub fn is_loopback(&self) -> bool
pub fn is_loopback(&self) -> bool
Query whether the IPv6 address is the loopback address.
pub fn is_ipv4_mapped(&self) -> bool
pub fn is_ipv4_mapped(&self) -> bool
Query whether the IPv6 address is an IPv4 mapped IPv6 address.
pub 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.
pub 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§
§impl Ord for Address
impl Ord for Address
§impl PartialOrd<Address> for Address
impl PartialOrd<Address> for Address
§fn partial_cmp(&self, other: &Address) -> Option<Ordering>
fn partial_cmp(&self, other: &Address) -> Option<Ordering>
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