Struct s2n_quic_core::inet::ipv6::IpV6Address
source · [−]#[repr(C)]pub struct IpV6Address { /* private fields */ }Implementations
sourceimpl IpV6Address
impl IpV6Address
sourcepub const UNSPECIFIED: Self = Self {
octets: [0; IPV6_LEN],
}
pub const UNSPECIFIED: Self = Self { octets: [0; IPV6_LEN], }
An unspecified IpV6Address
pub const fn segments(&self) -> [u16; 8]
sourcepub const fn unmap(self) -> IpAddress
pub const fn unmap(self) -> IpAddress
Converts the IP address into IPv4 if it is mapped, otherwise the address is unchanged
sourcepub const fn unicast_scope(self) -> Option<UnicastScope>
pub const fn unicast_scope(self) -> Option<UnicastScope>
Returns the ip::UnicastScope for the given address
See the IANA Registry for more details.
use s2n_quic_core::inet::{IpV4Address, IpV6Address, ip::UnicastScope::*};
assert_eq!(IpV6Address::from([0, 0, 0, 0, 0, 0, 0, 0]).unicast_scope(), None);
assert_eq!(IpV6Address::from([0, 0, 0, 0, 0, 0, 0, 1]).unicast_scope(), Some(Loopback));
assert_eq!(IpV6Address::from([0xff0e, 0, 0, 0, 0, 0, 0, 0]).unicast_scope(), None);
assert_eq!(IpV6Address::from([0xfe80, 0, 0, 0, 0, 0, 0, 0]).unicast_scope(), Some(LinkLocal));
assert_eq!(IpV6Address::from([0xfc02, 0, 0, 0, 0, 0, 0, 0]).unicast_scope(), Some(Private));
// documentation
assert_eq!(IpV6Address::from([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]).unicast_scope(), None);
// benchmarking
assert_eq!(IpV6Address::from([0x2001, 0x0200, 0, 0, 0, 0, 0, 0]).unicast_scope(), None);
// IPv4-mapped address
assert_eq!(IpV4Address::from([92, 88, 99, 123]).to_ipv6_mapped().unicast_scope(), Some(Global));Trait Implementations
sourceimpl AsBytes for IpV6Address
impl AsBytes for IpV6Address
sourcefn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Gets the bytes of this value. Read more
sourcefn as_bytes_mut(&mut self) -> &mut [u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8] where
Self: FromBytes,
fn as_bytes_mut(&mut self) -> &mut [u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8] where
Self: FromBytes,
Gets the bytes of this value mutably. Read more
sourcefn write_to<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
fn write_to<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
Writes a copy of self to bytes. Read more
sourcefn write_to_prefix<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
fn write_to_prefix<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
Writes a copy of self to the prefix of bytes. Read more
sourcefn write_to_suffix<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
fn write_to_suffix<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
Writes a copy of self to the suffix of bytes. Read more
sourceimpl Clone for IpV6Address
impl Clone for IpV6Address
sourcefn clone(&self) -> IpV6Address
fn clone(&self) -> IpV6Address
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for IpV6Address
impl Debug for IpV6Address
sourceimpl<'a> DecoderValue<'a> for IpV6Address
impl<'a> DecoderValue<'a> for IpV6Address
fn decode(buffer: DecoderBuffer<'a>) -> DecoderBufferResult<'_, Self>
sourceimpl<'a> DecoderValue<'a> for &'a IpV6Address
impl<'a> DecoderValue<'a> for &'a IpV6Address
fn decode(buffer: DecoderBuffer<'a>) -> DecoderBufferResult<'_, Self>
sourceimpl<'a> DecoderValueMut<'a> for IpV6Address
impl<'a> DecoderValueMut<'a> for IpV6Address
fn decode_mut(buffer: DecoderBufferMut<'a>) -> DecoderBufferMutResult<'_, Self>
sourceimpl<'a> DecoderValueMut<'a> for &'a IpV6Address
impl<'a> DecoderValueMut<'a> for &'a IpV6Address
fn decode_mut(buffer: DecoderBufferMut<'a>) -> DecoderBufferMutResult<'a, Self>
sourceimpl<'a> DecoderValueMut<'a> for &'a mut IpV6Address
impl<'a> DecoderValueMut<'a> for &'a mut IpV6Address
fn decode_mut(buffer: DecoderBufferMut<'a>) -> DecoderBufferMutResult<'a, Self>
sourceimpl Default for IpV6Address
impl Default for IpV6Address
sourcefn default() -> IpV6Address
fn default() -> IpV6Address
Returns the “default value” for a type. Read more
sourceimpl Display for IpV6Address
impl Display for IpV6Address
sourceimpl EncoderValue for IpV6Address
impl EncoderValue for IpV6Address
sourcefn encoding_size(&self) -> usize
fn encoding_size(&self) -> usize
Returns the encoding size with no buffer constrains
sourcefn encoding_size_for_encoder<E: Encoder>(&self, _encoder: &E) -> usize
fn encoding_size_for_encoder<E: Encoder>(&self, _encoder: &E) -> usize
Returns the encoding size for the given encoder’s capacity
sourcefn encode_mut<E>(&mut self, encoder: &mut E) where
E: Encoder,
fn encode_mut<E>(&mut self, encoder: &mut E) where
E: Encoder,
Encodes the value into the encoder, while potentially mutating the value itself
sourceimpl<'a> EncoderValue for &'a IpV6Address
impl<'a> EncoderValue for &'a IpV6Address
sourcefn encoding_size(&self) -> usize
fn encoding_size(&self) -> usize
Returns the encoding size with no buffer constrains
sourcefn encoding_size_for_encoder<E: Encoder>(&self, _encoder: &E) -> usize
fn encoding_size_for_encoder<E: Encoder>(&self, _encoder: &E) -> usize
Returns the encoding size for the given encoder’s capacity
sourcefn encode_mut<E>(&mut self, encoder: &mut E) where
E: Encoder,
fn encode_mut<E>(&mut self, encoder: &mut E) where
E: Encoder,
Encodes the value into the encoder, while potentially mutating the value itself
sourceimpl<'a> EncoderValue for &'a mut IpV6Address
impl<'a> EncoderValue for &'a mut IpV6Address
sourcefn encoding_size(&self) -> usize
fn encoding_size(&self) -> usize
Returns the encoding size with no buffer constrains
sourcefn encoding_size_for_encoder<E: Encoder>(&self, _encoder: &E) -> usize
fn encoding_size_for_encoder<E: Encoder>(&self, _encoder: &E) -> usize
Returns the encoding size for the given encoder’s capacity
sourcefn encode_mut<E>(&mut self, encoder: &mut E) where
E: Encoder,
fn encode_mut<E>(&mut self, encoder: &mut E) where
E: Encoder,
Encodes the value into the encoder, while potentially mutating the value itself
sourceimpl<'a> From<&'a IpV6Address> for IpAddressRef<'a>
impl<'a> From<&'a IpV6Address> for IpAddressRef<'a>
sourcefn from(ip: &'a IpV6Address) -> Self
fn from(ip: &'a IpV6Address) -> Self
Converts to this type from the input type.
sourceimpl From<&Ipv6Addr> for IpV6Address
impl From<&Ipv6Addr> for IpV6Address
sourceimpl From<IpV6Address> for IpAddress
impl From<IpV6Address> for IpAddress
sourcefn from(ip: IpV6Address) -> Self
fn from(ip: IpV6Address) -> Self
Converts to this type from the input type.
sourceimpl From<IpV6Address> for [u8; 16]
impl From<IpV6Address> for [u8; 16]
sourcefn from(v: IpV6Address) -> Self
fn from(v: IpV6Address) -> Self
Converts to this type from the input type.
sourceimpl From<IpV6Address> for [u16; 8]
impl From<IpV6Address> for [u16; 8]
sourcefn from(v: IpV6Address) -> Self
fn from(v: IpV6Address) -> Self
Converts to this type from the input type.
sourceimpl From<IpV6Address> for Ipv6Addr
impl From<IpV6Address> for Ipv6Addr
sourcefn from(address: IpV6Address) -> Self
fn from(address: IpV6Address) -> Self
Converts to this type from the input type.
sourceimpl From<Ipv6Addr> for IpV6Address
impl From<Ipv6Addr> for IpV6Address
sourceimpl FromBytes for IpV6Address
impl FromBytes for IpV6Address
sourcefn read_from<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
fn read_from<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
Reads a copy of Self from bytes. Read more
sourcefn read_from_prefix<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
fn read_from_prefix<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
Reads a copy of Self from the prefix of bytes. Read more
sourcefn read_from_suffix<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
fn read_from_suffix<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
Reads a copy of Self from the suffix of bytes. Read more
sourcefn new_zeroed() -> Self
fn new_zeroed() -> Self
Creates an instance of Self from zeroed bytes.
sourceimpl Hash for IpV6Address
impl Hash for IpV6Address
sourceimpl Ord for IpV6Address
impl Ord for IpV6Address
sourceimpl PartialEq<IpV6Address> for IpV6Address
impl PartialEq<IpV6Address> for IpV6Address
sourceimpl PartialOrd<IpV6Address> for IpV6Address
impl PartialOrd<IpV6Address> for IpV6Address
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn 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
sourceimpl Unspecified for IpV6Address
impl Unspecified for IpV6Address
sourcefn is_unspecified(&self) -> bool
fn is_unspecified(&self) -> bool
Returns true if the value is unspecified
sourcefn filter_unspecified(self) -> Option<Self>
fn filter_unspecified(self) -> Option<Self>
Coerce a potentially unspecified value into an Option
impl Copy for IpV6Address
impl Eq for IpV6Address
impl StructuralEq for IpV6Address
impl Unaligned for IpV6Address
Auto Trait Implementations
impl RefUnwindSafe for IpV6Address
impl Send for IpV6Address
impl Sync for IpV6Address
impl Unpin for IpV6Address
impl UnwindSafe for IpV6Address
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> PacketPayloadEncoder for T where
T: EncoderValue,
impl<T> PacketPayloadEncoder for T where
T: EncoderValue,
sourcefn encoding_size_hint<E>(&mut self, encoder: &E, minimum_len: usize) -> usize where
E: Encoder,
fn encoding_size_hint<E>(&mut self, encoder: &E, minimum_len: usize) -> usize where
E: Encoder,
Returns an estimate of the encoding size of the payload. This may be inaccurate from what actually is encoded. Estimates should be less than or equal to what is actually written. Implementations can return 0 to skip encoding. Read more