pub struct Ipv4Hint<Octs: ?Sized>(/* private fields */);
Expand description
The ‘ipv4hint’ service parameter value.
This values provides a list of IPv4 addresses that the client may use to connect to the endpoint. The value is intended to speed up connecting but not to replace the A query to get the actual IPv4 addresses of the endpoint. That is, the client can start an A query and at the same time connect to an IP address from the value. If the A 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 IPv4 addresses.
Implementations§
source§impl<Octs> Ipv4Hint<Octs>
impl<Octs> Ipv4Hint<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 Ipv4Hint<[u8]>
impl Ipv4Hint<[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> Ipv4Hint<Octs>
impl<Octs: AsRef<[u8]> + ?Sized> Ipv4Hint<Octs>
sourcepub fn iter(&self) -> Ipv4HintIter<'_, Octs> ⓘ
pub fn iter(&self) -> Ipv4HintIter<'_, Octs> ⓘ
Returns an iterator over the elements of the value.
source§impl<Octs: AsRef<[u8]>> Ipv4Hint<Octs>
impl<Octs: AsRef<[u8]>> Ipv4Hint<Octs>
sourcepub fn from_octets(octets: Octs) -> Result<Self, ParseError>
pub fn from_octets(octets: Octs) -> Result<Self, ParseError>
Creates a new ipv4hint 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 = Ipv4Addr>,
) -> Result<Self, BuildValueError>
pub fn from_addrs( addrs: impl IntoIterator<Item = Ipv4Addr>, ) -> Result<Self, BuildValueError>
Creates a new value from a list of IPv4 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 Ipv4Hint<[u8]>
impl Ipv4Hint<[u8]>
sourcepub fn from_slice(slice: &[u8]) -> Result<&Self, ParseError>
pub fn from_slice(slice: &[u8]) -> Result<&Self, ParseError>
Creates a new ipv4hint 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 Ipv4Hint<Octs>
impl<Octs: AsRef<[u8]> + ?Sized> ComposeSvcParamValue for Ipv4Hint<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<Ipv4Hint<O>> for Ipv4Hint<OO>where
OO: OctetsFrom<O>,
impl<O, OO> OctetsFrom<Ipv4Hint<O>> for Ipv4Hint<OO>where
OO: OctetsFrom<O>,
source§impl<'a, Octs> ParseSvcParamValue<'a, Octs> for Ipv4Hint<Octs::Range<'a>>
impl<'a, Octs> ParseSvcParamValue<'a, Octs> for Ipv4Hint<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 Ipv4Hint<Octs>
impl<Octs: ?Sized> SvcParamValue for Ipv4Hint<Octs>
source§fn key(&self) -> SvcParamKey
fn key(&self) -> SvcParamKey
impl<Octs: AsRef<[u8]>> Eq for Ipv4Hint<Octs>
Auto Trait Implementations§
impl<Octs> Freeze for Ipv4Hint<Octs>
impl<Octs> RefUnwindSafe for Ipv4Hint<Octs>where
Octs: RefUnwindSafe + ?Sized,
impl<Octs> Send for Ipv4Hint<Octs>
impl<Octs> Sync for Ipv4Hint<Octs>
impl<Octs> Unpin for Ipv4Hint<Octs>
impl<Octs> UnwindSafe for Ipv4Hint<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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)