pub type Svcb<Octs, Name> = SvcbRdata<SvcbVariant, Octs, Name>;
Expand description
A type alias for record data of the SVCB record type.
The SVCB record type is the generic type for service bindings of any service for which no special record type exists.
See SvcbRdata<..>
for details.
Aliased Type§
struct Svcb<Octs, Name> { /* private fields */ }
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>
Returns the length of the record data if available. Read more
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>
Appends the wire format of the record data into
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>
Appends the canonical wire format of the record data into
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>
Appends the record data prefixed with its length.
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>
Appends the record data prefixed with its length.
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>
fn flatten_into(self) -> Target
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§fn try_octets_from(
source: SvcbRdata<Variant, SrcOctets, SrcName>,
) -> Result<Self, Self::Error>
fn try_octets_from( source: SvcbRdata<Variant, SrcOctets, SrcName>, ) -> Result<Self, Self::Error>
Performs the conversion.
Source§fn octets_from(source: Source) -> Self
fn octets_from(source: Source) -> Self
Performs an infallible conversion.
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<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>
Parses the record data. Read more