pub struct Ipv6Hint<Octs: ?Sized>(/* private fields */);
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>
pub fn from_addrs( addrs: impl IntoIterator<Item = Ipv6Addr>, ) -> Result<Self, BuildValueError>
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
.source§impl<O, OO> OctetsFrom<Ipv6Hint<O>> for Ipv6Hint<OO>where
OO: OctetsFrom<O>,
impl<O, OO> OctetsFrom<Ipv6Hint<O>> for Ipv6Hint<OO>where
OO: OctetsFrom<O>,
type Error = <OO as OctetsFrom<O>>::Error
source§impl<'a, Octs> ParseSvcParamValue<'a, Octs> for Ipv6Hint<Octs::Range<'a>>
impl<'a, Octs> ParseSvcParamValue<'a, Octs> for Ipv6Hint<Octs::Range<'a>>
source§fn parse_value(
key: SvcParamKey,
parser: &mut Parser<'a, Octs>,
) -> Result<Option<Self>, ParseError>
fn parse_value( key: SvcParamKey, parser: &mut Parser<'a, Octs>, ) -> Result<Option<Self>, ParseError>
source§impl<Octs: ?Sized> SvcParamValue for Ipv6Hint<Octs>
impl<Octs: ?Sized> SvcParamValue for Ipv6Hint<Octs>
source§fn key(&self) -> SvcParamKey
fn key(&self) -> SvcParamKey
impl<Octs: AsRef<[u8]>> Eq for Ipv6Hint<Octs>
Auto Trait Implementations§
impl<Octs> Freeze for Ipv6Hint<Octs>
impl<Octs> RefUnwindSafe for Ipv6Hint<Octs>where
Octs: RefUnwindSafe + ?Sized,
impl<Octs> Send for Ipv6Hint<Octs>
impl<Octs> Sync for Ipv6Hint<Octs>
impl<Octs> Unpin for Ipv6Hint<Octs>
impl<Octs> UnwindSafe for Ipv6Hint<Octs>where
Octs: UnwindSafe + ?Sized,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)