pub struct SvcbRecord<'a>(/* private fields */);Expand description
Typed view of an SVCB record.
Implementations§
Source§impl<'a> SvcbRecord<'a>
impl<'a> SvcbRecord<'a>
Sourcepub fn priority(self) -> u16
pub fn priority(self) -> u16
SvcPriority (SVCB_PRIORITY).
Sourcepub fn target(self) -> &'a str
pub fn target(self) -> &'a str
TargetName (SVCB_TARGET).
Sourcepub fn param_count(self) -> usize
pub fn param_count(self) -> usize
Returns the number of SvcParams
(SVCB_PARAMS).
Sourcepub fn params(
self,
) -> impl Iterator<Item = (u16, Result<OptValue, OptParseError>)> + 'a
pub fn params( self, ) -> impl Iterator<Item = (u16, Result<OptValue, OptParseError>)> + 'a
Returns an iterator over SvcParams
(SVCB_PARAMS) yielding
(param_key, decoded_value) pairs.
The value is decoded according to its registered datatype (see
OptValue). For parameters the linked c-ares does not
recognise, decoding may fail; use raw_params
to access the underlying byte slice instead.
Sourcepub fn raw_params(self) -> impl Iterator<Item = (u16, &'a [u8])>
pub fn raw_params(self) -> impl Iterator<Item = (u16, &'a [u8])>
Returns an iterator over SvcParams
(SVCB_PARAMS) yielding
(param_key, value_bytes) pairs without decoding.
Trait Implementations§
Source§impl<'a> Clone for SvcbRecord<'a>
impl<'a> Clone for SvcbRecord<'a>
Source§fn clone(&self) -> SvcbRecord<'a>
fn clone(&self) -> SvcbRecord<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for SvcbRecord<'a>
Auto Trait Implementations§
impl<'a> Freeze for SvcbRecord<'a>
impl<'a> RefUnwindSafe for SvcbRecord<'a>
impl<'a> Send for SvcbRecord<'a>
impl<'a> Sync for SvcbRecord<'a>
impl<'a> Unpin for SvcbRecord<'a>
impl<'a> UnsafeUnpin for SvcbRecord<'a>
impl<'a> UnwindSafe for SvcbRecord<'a>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more