pub struct Ipv6Hint<Octs: ?Sized>(_);
Expand description
The ‘ipv6hint’ service parameter value.
This values provides a list of IPv6 addresses that the client may use to connect to the endpoint. The value is intended to speed up connecting but not to replace the AAAA query to get the actual IPv6 addresses of the endpoint. That is, the client can start an AAAA query and at the same time connect to an IP address from the value. If the AAAA query doesn’t return this IP address, it may want to start again with an address from the response.
The type contains the value in its wire format which consists of the sequence of IPv6 addresses.
Implementations§
source§impl<Octs> Ipv6Hint<Octs>
impl<Octs> Ipv6Hint<Octs>
sourcepub unsafe fn from_octets_unchecked(octets: Octs) -> Self
pub unsafe fn from_octets_unchecked(octets: Octs) -> Self
Creates a new value from octets without checking.
Safety
The caller has to ensure that octets
contains a properly
formated value of at most 65,535 octets.
source§impl Ipv6Hint<[u8]>
impl Ipv6Hint<[u8]>
sourcepub unsafe fn from_slice_unchecked(slice: &[u8]) -> &Self
pub unsafe fn from_slice_unchecked(slice: &[u8]) -> &Self
Creates a new value for a slice without checking.
Safety
The caller has to ensure that slice
contains a properly
formated value of at most 65,535 octets.
source§impl<Octs: AsRef<[u8]> + ?Sized> Ipv6Hint<Octs>
impl<Octs: AsRef<[u8]> + ?Sized> Ipv6Hint<Octs>
sourcepub fn iter(&self) -> Ipv6HintIter<'_, Octs> ⓘ
pub fn iter(&self) -> Ipv6HintIter<'_, Octs> ⓘ
Returns an iterator over the elements of the value.
source§impl<Octs: AsRef<[u8]>> Ipv6Hint<Octs>
impl<Octs: AsRef<[u8]>> Ipv6Hint<Octs>
sourcepub fn from_octets(octets: Octs) -> Result<Self, ParseError>
pub fn from_octets(octets: Octs) -> Result<Self, ParseError>
Creates a new ipv6hint value from its content.
The function returns an error if octets
doesn’t contain a
correctly encoded value or if it is longer than 65,535 octets.
sourcepub fn from_addrs(
addrs: impl IntoIterator<Item = Ipv6Addr>
) -> Result<Self, BuildValueError>where
Octs: FromBuilder,
<Octs as FromBuilder>::Builder: EmptyBuilder,
pub fn from_addrs( addrs: impl IntoIterator<Item = Ipv6Addr> ) -> Result<Self, BuildValueError>where Octs: FromBuilder, <Octs as FromBuilder>::Builder: EmptyBuilder,
Creates a new value from a list of IPv6 addresses.
The function will fail if the iterator returns more than 16,383 addresses or if the octets builder to be used for building runs out of space.
source§impl Ipv6Hint<[u8]>
impl Ipv6Hint<[u8]>
sourcepub fn from_slice(slice: &[u8]) -> Result<&Self, ParseError>
pub fn from_slice(slice: &[u8]) -> Result<&Self, ParseError>
Creates a new ‘ipv6hint’ value from a slice of its content.
The function returns an error if slice
doesn’t contain a
correctly encoded value or if it is longer than 65,535 octets.
Trait Implementations§
source§impl<Octs: AsRef<[u8]> + ?Sized> ComposeSvcParamValue for Ipv6Hint<Octs>
impl<Octs: AsRef<[u8]> + ?Sized> ComposeSvcParamValue for Ipv6Hint<Octs>
source§fn compose_len(&self) -> u16
fn compose_len(&self) -> u16
source§fn compose_value<Target: OctetsBuilder + ?Sized>(
&self,
target: &mut Target
) -> Result<(), Target::AppendError>
fn compose_value<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target ) -> Result<(), Target::AppendError>
target
.