pub struct Ipv6Addr { /* private fields */ }Expand description
An IPv6 address.
Implementations§
Source§impl Ipv6Addr
impl Ipv6Addr
Sourcepub const UNSPECIFIED: Self
pub const UNSPECIFIED: Self
The unspecified IPv6 address, i.e., :: or all zeros.
Sourcepub const fn from_octets(bytes: [u8; 16]) -> Self
pub const fn from_octets(bytes: [u8; 16]) -> Self
Creates an Ipv6Addr from a sixteen element byte array.
Sourcepub const fn from_segments(words: [u16; 8]) -> Self
pub const fn from_segments(words: [u16; 8]) -> Self
Creates an Ipv6Addr from an eight element 16-bit array.
Sourcepub const fn segments(&self) -> [u16; 8]
pub const fn segments(&self) -> [u16; 8]
Returns an eight element 16-bit array representation of the address.
This is taken from the core Ipv6Addr implementation.
Sourcepub const fn is_multicast(&self) -> bool
pub const fn is_multicast(&self) -> bool
Returns true if the address is a multicast address.
Sourcepub const fn is_loopback(&self) -> bool
pub const fn is_loopback(&self) -> bool
Returns true if the address is a loopback address.
Sourcepub const fn is_unicast(&self) -> bool
pub const fn is_unicast(&self) -> bool
Returns true if the address is a unicast address.
Sourcepub const fn is_unicast_link_local(&self) -> bool
pub const fn is_unicast_link_local(&self) -> bool
Returns true if the address is a unicast link-local address.
Note: The underlying core::net version is not yet stable as
of Rust 1.84.1.
Sourcepub const fn is_unique_local(&self) -> bool
pub const fn is_unique_local(&self) -> bool
Returns true if the address is a unique local address.
Note: The underlying core::net version is not yet stable as
of Rust 1.84.1.
Sourcepub const fn is_unicast_global(&self) -> bool
pub const fn is_unicast_global(&self) -> bool
Returns true if the address is a global unicast address.
Sourcepub const fn is_documentation(&self) -> bool
pub const fn is_documentation(&self) -> bool
Returns true if the address is a documentation address.
Defined in IETF RFC 3849.
Note: The underlying core::net version is not yet stable as
of Rust 1.84.1.
Trait Implementations§
Source§impl Emit for Ipv6Addr
impl Emit for Ipv6Addr
Source§fn emit_raw<V: ByteSliceMut>(&self, buf: V) -> usize
fn emit_raw<V: ByteSliceMut>(&self, buf: V) -> usize
Source§fn needs_emit(&self) -> bool
fn needs_emit(&self) -> bool
Source§fn emit<V: ByteSliceMut>(&self, buf: V) -> ParseResult<usize>
fn emit<V: ByteSliceMut>(&self, buf: V) -> ParseResult<usize>
Source§fn emit_prefix<V: SplitByteSliceMut>(&self, buf: V) -> ParseResult<V>
fn emit_prefix<V: SplitByteSliceMut>(&self, buf: V) -> ParseResult<V>
Source§fn emit_suffix<V: SplitByteSliceMut>(&self, buf: V) -> ParseResult<V>
fn emit_suffix<V: SplitByteSliceMut>(&self, buf: V) -> ParseResult<V>
Source§impl FromBytes for Ipv6Addr
impl FromBytes for Ipv6Addr
Source§fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
Source§fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
Source§fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: Immutable + KnownLayout,
fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: Immutable + KnownLayout,
&Self. Read moreSource§fn mut_from_bytes(
source: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_bytes(
source: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
Source§fn mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
Source§fn mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
Source§impl HeaderLen for Ipv6Addr
impl HeaderLen for Ipv6Addr
Source§const MINIMUM_LENGTH: usize = 16usize
const MINIMUM_LENGTH: usize = 16usize
Source§fn packet_length(&self) -> usize
fn packet_length(&self) -> usize
Source§impl IntoBytes for Ipv6Addr
impl IntoBytes for Ipv6Addr
Source§fn as_mut_bytes(&mut self) -> &mut [u8]where
Self: FromBytes,
fn as_mut_bytes(&mut self) -> &mut [u8]where
Self: FromBytes,
Source§fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
Source§impl KnownLayout for Ipv6Addrwhere
Self: Sized,
impl KnownLayout for Ipv6Addrwhere
Self: Sized,
Source§type PointerMetadata = ()
type PointerMetadata = ()
Self. Read moreSource§fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>
fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>
Self with the given pointer
metadata. Read more