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>where
Octs: AsRef<[u8]>,
Name: ToDname,
pub fn new( priority: u16, target: Name, params: SvcParams<Octs> ) -> Result<Self, LongRecordData>where Octs: AsRef<[u8]>, Name: ToDname,
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
.
source§impl<Variant, Octs, NOcts> SvcbRdata<Variant, Octs, ParsedDname<NOcts>>
impl<Variant, Octs, NOcts> SvcbRdata<Variant, Octs, ParsedDname<NOcts>>
sourcepub fn flatten_into<Target>(
self
) -> Result<SvcbRdata<Variant, Target, Dname<Target>>, PushNameError>where
NOcts: Octets,
Target: OctetsFrom<Octs> + for<'a> OctetsFrom<NOcts::Range<'a>> + FromBuilder,
<Target as FromBuilder>::Builder: EmptyBuilder,
pub fn flatten_into<Target>( self ) -> Result<SvcbRdata<Variant, Target, Dname<Target>>, PushNameError>where NOcts: Octets, Target: OctetsFrom<Octs> + for<'a> OctetsFrom<NOcts::Range<'a>> + FromBuilder, <Target as FromBuilder>::Builder: EmptyBuilder,
Flattens a value using a parsed name into a flat name.
Trait Implementations§
source§impl<Variant, Octs, Name> ComposeRecordData for SvcbRdata<Variant, Octs, Name>where
Self: RecordData,
Octs: AsRef<[u8]>,
Name: ToDname,
impl<Variant, Octs, Name> ComposeRecordData for SvcbRdata<Variant, Octs, Name>where Self: RecordData, Octs: AsRef<[u8]>, Name: ToDname,
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, Name> Debug for SvcbRdata<Variant, Octs, Name>where
Octs: Octets,
Name: Debug,
impl<Variant, Octs, Name> Debug for SvcbRdata<Variant, Octs, Name>where Octs: Octets, Name: Debug,
source§impl<Variant, Octs, Name> Display for SvcbRdata<Variant, Octs, Name>where
Octs: Octets,
Name: Display,
impl<Variant, Octs, Name> Display for SvcbRdata<Variant, Octs, Name>where Octs: Octets, Name: Display,
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>where
Octs: OctetsFrom<SrcOctets>,
Name: OctetsFrom<SrcName, Error = Octs::Error>,
impl<Variant, Octs, SrcOctets, Name, SrcName> OctetsFrom<SvcbRdata<Variant, SrcOctets, SrcName>> for SvcbRdata<Variant, Octs, Name>where Octs: OctetsFrom<SrcOctets>, Name: OctetsFrom<SrcName, Error = Octs::Error>,
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>where
Octs: AsRef<[u8]>,
OtherOcts: AsRef<[u8]>,
Name: ToDname,
OtherName: ToDname,
impl<Variant, OtherVariant, Octs, OtherOcts, Name, OtherName> PartialEq<SvcbRdata<OtherVariant, OtherOcts, OtherName>> for SvcbRdata<Variant, Octs, Name>where Octs: AsRef<[u8]>, OtherOcts: AsRef<[u8]>, Name: ToDname, OtherName: ToDname,
source§impl<Variant, OtherVariant, Octs, OtherOcts, Name, OtherName> PartialOrd<SvcbRdata<OtherVariant, OtherOcts, OtherName>> for SvcbRdata<Variant, Octs, Name>where
Octs: AsRef<[u8]>,
OtherOcts: AsRef<[u8]>,
Name: ToDname,
OtherName: ToDname,
impl<Variant, OtherVariant, Octs, OtherOcts, Name, OtherName> PartialOrd<SvcbRdata<OtherVariant, OtherOcts, OtherName>> for SvcbRdata<Variant, Octs, Name>where Octs: AsRef<[u8]>, OtherOcts: AsRef<[u8]>, Name: ToDname, OtherName: ToDname,
source§fn partial_cmp(
&self,
other: &SvcbRdata<OtherVariant, OtherOcts, OtherName>
) -> Option<Ordering>
fn partial_cmp( &self, other: &SvcbRdata<OtherVariant, OtherOcts, OtherName> ) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more