pub struct SvcbRdata<Variant, Octs, Name> { /* private fields */ }
Expand description
Service binding record data.
This type provides the record data for the various service binding record
types. The particular record type is encoded via the Variant
type
argument with marker types representing the concrete types. Currently
these are ScvbVariant
for the SVCB record type and HttpsVariant
for
HTTPS. The aliases Svcb<..>
and Https<..>
are available for less
typing.
The service binding record data contains three fields: a integer
priority, a target name – the type of which is determined by the Name
type argument –, and a sequence of service parameters. A separate type
SvcParams
has been defined for those which is generic over an
octets sequence determined by the Octs
type argument.
The record can be used in one of two modes, ‘alias mode’ or ‘service mode.’
In alias mode, there should only be one record with its priority set to 0 and no service parameters. In this case, the target name indicates the name that actually provides the service and should be resolved further. The root name can be used as the target name to indicate that the particular service is not being provided.
In ‘service mode,’ one or more records can exist and used in the order provided by the priority field with lower priority looked at first. Each record describes an alternative endpoint for the service and parameters for its use. What exactly this means depends on the protocol in question.
The owner name of service binding records determines which service the
records apply to. The domain name for which the service is provided is
prefixed by first the port and protocol of the service, both as
underscore labels. So, for HTTPS on port 443, the prefix would be
_443._https
. However, the HTTPS record type allows to drop the prefix
in that particular case.
Note that the above is a wholy inadequate summary of service bindings records. For accurate details, see draft-ietf-dnsop-svcb-https.
Implementations§
source§impl<Variant, Octs, Name> SvcbRdata<Variant, Octs, Name>
impl<Variant, Octs, Name> SvcbRdata<Variant, Octs, Name>
sourcepub fn new(
priority: u16,
target: Name,
params: SvcParams<Octs>,
) -> Result<Self, LongRecordData>
pub fn new( priority: u16, target: Name, params: SvcParams<Octs>, ) -> Result<Self, LongRecordData>
Create a new value from its components.
Returns an error if the wire format of the record data would exceed the length of 65,535 octets.
sourcepub unsafe fn new_unchecked(
priority: u16,
target: Name,
params: SvcParams<Octs>,
) -> Self
pub unsafe fn new_unchecked( priority: u16, target: Name, params: SvcParams<Octs>, ) -> Self
Creates a new value from its components without checking.
§Safety
The called must ensure that the wire format of the record data does not exceed a length of 65,535 octets.
source§impl<Variant, Octs, Name> SvcbRdata<Variant, Octs, Name>
impl<Variant, Octs, Name> SvcbRdata<Variant, Octs, Name>
sourcepub fn is_alias(&self) -> bool
pub fn is_alias(&self) -> bool
Returns whether this service binding is in alias mode.
This is identical to self.priority() == 0
.
sourcepub fn is_service(&self) -> bool
pub fn is_service(&self) -> bool
Returns whether this service binding is in service mode.
This is identical to self.priority() != 0
.
Trait Implementations§
source§impl<Variant, Octs, Name> ComposeRecordData for SvcbRdata<Variant, Octs, Name>
impl<Variant, Octs, Name> ComposeRecordData for SvcbRdata<Variant, Octs, Name>
source§fn rdlen(&self, _compress: bool) -> Option<u16>
fn rdlen(&self, _compress: bool) -> Option<u16>
source§fn compose_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
target
.source§fn compose_canonical_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_canonical_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
target
.source§fn compose_len_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_len_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
source§fn compose_canonical_len_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_canonical_len_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
source§impl<Variant, Octs, TOcts, Name, TName> FlattenInto<SvcbRdata<Variant, TOcts, TName>> for SvcbRdata<Variant, Octs, Name>
impl<Variant, Octs, TOcts, Name, TName> FlattenInto<SvcbRdata<Variant, TOcts, TName>> for SvcbRdata<Variant, Octs, Name>
type AppendError = <TOcts as OctetsFrom<Octs>>::Error
fn try_flatten_into( self, ) -> Result<SvcbRdata<Variant, TOcts, TName>, TOcts::Error>
source§impl<O, N> From<SvcbRdata<HttpsVariant, O, N>> for AllRecordData<O, N>
impl<O, N> From<SvcbRdata<HttpsVariant, O, N>> for AllRecordData<O, N>
source§impl<O, N> From<SvcbRdata<SvcbVariant, O, N>> for AllRecordData<O, N>
impl<O, N> From<SvcbRdata<SvcbVariant, O, N>> for AllRecordData<O, N>
source§impl<Variant, Octs, SrcOctets, Name, SrcName> OctetsFrom<SvcbRdata<Variant, SrcOctets, SrcName>> for SvcbRdata<Variant, Octs, Name>
impl<Variant, Octs, SrcOctets, Name, SrcName> OctetsFrom<SvcbRdata<Variant, SrcOctets, SrcName>> for SvcbRdata<Variant, Octs, Name>
type Error = <Octs as OctetsFrom<SrcOctets>>::Error
source§impl<Variant, Octs: AsRef<[u8]>, Name: ToDname> Ord for SvcbRdata<Variant, Octs, Name>
impl<Variant, Octs: AsRef<[u8]>, Name: ToDname> Ord for SvcbRdata<Variant, Octs, Name>
source§impl<'a, Octs: Octets + ?Sized> ParseRecordData<'a, Octs> for SvcbRdata<HttpsVariant, Octs::Range<'a>, ParsedDname<Octs::Range<'a>>>
impl<'a, Octs: Octets + ?Sized> ParseRecordData<'a, Octs> for SvcbRdata<HttpsVariant, Octs::Range<'a>, ParsedDname<Octs::Range<'a>>>
source§fn parse_rdata(
rtype: Rtype,
parser: &mut Parser<'a, Octs>,
) -> Result<Option<Self>, ParseError>
fn parse_rdata( rtype: Rtype, parser: &mut Parser<'a, Octs>, ) -> Result<Option<Self>, ParseError>
source§impl<'a, Octs: Octets + ?Sized> ParseRecordData<'a, Octs> for SvcbRdata<SvcbVariant, Octs::Range<'a>, ParsedDname<Octs::Range<'a>>>
impl<'a, Octs: Octets + ?Sized> ParseRecordData<'a, Octs> for SvcbRdata<SvcbVariant, Octs::Range<'a>, ParsedDname<Octs::Range<'a>>>
source§fn parse_rdata(
rtype: Rtype,
parser: &mut Parser<'a, Octs>,
) -> Result<Option<Self>, ParseError>
fn parse_rdata( rtype: Rtype, parser: &mut Parser<'a, Octs>, ) -> Result<Option<Self>, ParseError>
source§impl<Variant, OtherVariant, Octs, OtherOcts, Name, OtherName> PartialEq<SvcbRdata<OtherVariant, OtherOcts, OtherName>> for SvcbRdata<Variant, Octs, Name>
impl<Variant, OtherVariant, Octs, OtherOcts, Name, OtherName> PartialEq<SvcbRdata<OtherVariant, OtherOcts, OtherName>> for SvcbRdata<Variant, Octs, Name>
source§impl<Variant, OtherVariant, Octs, OtherOcts, Name, OtherName> PartialOrd<SvcbRdata<OtherVariant, OtherOcts, OtherName>> for SvcbRdata<Variant, Octs, Name>
impl<Variant, OtherVariant, Octs, OtherOcts, Name, OtherName> PartialOrd<SvcbRdata<OtherVariant, OtherOcts, OtherName>> for SvcbRdata<Variant, Octs, Name>
source§impl<Octs, Name> RecordData for SvcbRdata<HttpsVariant, Octs, Name>
impl<Octs, Name> RecordData for SvcbRdata<HttpsVariant, Octs, Name>
source§impl<Octs, Name> RecordData for SvcbRdata<SvcbVariant, Octs, Name>
impl<Octs, Name> RecordData for SvcbRdata<SvcbVariant, Octs, Name>
impl<Variant, Octs: AsRef<[u8]>, Name: ToDname> Eq for SvcbRdata<Variant, Octs, Name>
Auto Trait Implementations§
impl<Variant, Octs, Name> Freeze for SvcbRdata<Variant, Octs, Name>
impl<Variant, Octs, Name> RefUnwindSafe for SvcbRdata<Variant, Octs, Name>
impl<Variant, Octs, Name> Send for SvcbRdata<Variant, Octs, Name>
impl<Variant, Octs, Name> Sync for SvcbRdata<Variant, Octs, Name>
impl<Variant, Octs, Name> Unpin for SvcbRdata<Variant, Octs, Name>
impl<Variant, Octs, Name> UnwindSafe for SvcbRdata<Variant, Octs, Name>
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
)