Struct domain::rdata::svcb::UnknownSvcParam
source · pub struct UnknownSvcParam<Octs> { /* private fields */ }
Expand description
A service binding parameter value in its raw form.
This type can be used for any value type. It keeps the value’s data in its raw wire format.
Implementations§
source§impl<Octs> UnknownSvcParam<Octs>
impl<Octs> UnknownSvcParam<Octs>
sourcepub fn new(key: SvcParamKey, value: Octs) -> Result<Self, LongSvcParam>where
Octs: AsRef<[u8]>,
pub fn new(key: SvcParamKey, value: Octs) -> Result<Self, LongSvcParam>where Octs: AsRef<[u8]>,
Creates a new parameter value from the given key and data.
The function returns an error if value
is longer than 65,535 octets.
sourcepub unsafe fn new_unchecked(key: SvcParamKey, value: Octs) -> Self
pub unsafe fn new_unchecked(key: SvcParamKey, value: Octs) -> Self
Creates a new SVCB parameter value without checking.
Safety
The caller needs to make sure that value
is not longer than
65,535 octets.
source§impl<Octs: AsRef<[u8]>> UnknownSvcParam<Octs>
impl<Octs: AsRef<[u8]>> UnknownSvcParam<Octs>
sourcepub fn parse<'a, Src: Octets<Range<'a> = Octs> + ?Sized>(
key: SvcParamKey,
parser: &mut Parser<'a, Src>
) -> Result<Self, ParseError>
pub fn parse<'a, Src: Octets<Range<'a> = Octs> + ?Sized>( key: SvcParamKey, parser: &mut Parser<'a, Src> ) -> Result<Self, ParseError>
Parses a parameter value’s data from its wire format.
sourcepub fn parse_param<'a, Src: Octets<Range<'a> = Octs> + ?Sized>(
parser: &mut Parser<'a, Src>
) -> Result<Self, ParseError>
pub fn parse_param<'a, Src: Octets<Range<'a> = Octs> + ?Sized>( parser: &mut Parser<'a, Src> ) -> Result<Self, ParseError>
Parses a full parameter from the wire format.
This function parses the key, length, and data of the parameter.
sourcepub fn compose_param<Target: OctetsBuilder + ?Sized>(
&self,
target: &mut Target
) -> Result<(), Target::AppendError>
pub fn compose_param<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target ) -> Result<(), Target::AppendError>
Appends the wire format of the full parameter to the target.
This includes the key and length of the parameter.
source§impl<Octs> UnknownSvcParam<Octs>
impl<Octs> UnknownSvcParam<Octs>
sourcepub fn key(&self) -> SvcParamKey
pub fn key(&self) -> SvcParamKey
Returns the key of the value.
Trait Implementations§
source§impl<Octs> AsRef<Octs> for UnknownSvcParam<Octs>
impl<Octs> AsRef<Octs> for UnknownSvcParam<Octs>
source§impl<Octs: Clone> Clone for UnknownSvcParam<Octs>
impl<Octs: Clone> Clone for UnknownSvcParam<Octs>
source§fn clone(&self) -> UnknownSvcParam<Octs>
fn clone(&self) -> UnknownSvcParam<Octs>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Octs: AsRef<[u8]>> ComposeSvcParamValue for UnknownSvcParam<Octs>
impl<Octs: AsRef<[u8]>> ComposeSvcParamValue for UnknownSvcParam<Octs>
source§fn compose_len(&self) -> u16
fn compose_len(&self) -> u16
Returns the length of the composed value.
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>
Appends the wire format of the value to the end of
target
.source§impl<Octs: Debug> Debug for UnknownSvcParam<Octs>
impl<Octs: Debug> Debug for UnknownSvcParam<Octs>
source§impl<Octs> From<UnknownSvcParam<Octs>> for AllValues<Octs>
impl<Octs> From<UnknownSvcParam<Octs>> for AllValues<Octs>
source§fn from(p: UnknownSvcParam<Octs>) -> Self
fn from(p: UnknownSvcParam<Octs>) -> Self
Converts to this type from the input type.
source§impl<'a, Octs: Octets + ?Sized> ParseSvcParamValue<'a, Octs> for UnknownSvcParam<Octs::Range<'a>>
impl<'a, Octs: Octets + ?Sized> ParseSvcParamValue<'a, Octs> for UnknownSvcParam<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>
Parse a parameter value from wire format. Read more
source§impl<Octs, OtherOcts> PartialEq<UnknownSvcParam<OtherOcts>> for UnknownSvcParam<Octs>where
Octs: AsRef<[u8]>,
OtherOcts: AsRef<[u8]>,
impl<Octs, OtherOcts> PartialEq<UnknownSvcParam<OtherOcts>> for UnknownSvcParam<Octs>where Octs: AsRef<[u8]>, OtherOcts: AsRef<[u8]>,
source§fn eq(&self, other: &UnknownSvcParam<OtherOcts>) -> bool
fn eq(&self, other: &UnknownSvcParam<OtherOcts>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<Octs> SvcParamValue for UnknownSvcParam<Octs>
impl<Octs> SvcParamValue for UnknownSvcParam<Octs>
source§fn key(&self) -> SvcParamKey
fn key(&self) -> SvcParamKey
Returns the parameter key of the value.
impl<Octs: AsRef<[u8]>> Eq for UnknownSvcParam<Octs>
Auto Trait Implementations§
impl<Octs> RefUnwindSafe for UnknownSvcParam<Octs>where Octs: RefUnwindSafe,
impl<Octs> Send for UnknownSvcParam<Octs>where Octs: Send,
impl<Octs> Sync for UnknownSvcParam<Octs>where Octs: Sync,
impl<Octs> Unpin for UnknownSvcParam<Octs>where Octs: Unpin,
impl<Octs> UnwindSafe for UnknownSvcParam<Octs>where Octs: UnwindSafe,
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<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
source§fn try_octets_into(
self
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
source§fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
fn octets_into(self) -> Targetwhere Self::Error: Into<Infallible>,
Performs an infallible conversion.