Struct domain::base::record::RecordHeader
source · pub struct RecordHeader<Name> { /* private fields */ }
Expand description
The header of a resource record.
This type encapsulates the common header of a resource record. It consists of the owner, record type, class, TTL, and the length of the record data. It is effectively a helper type for dealing with resource records encoded in a DNS message.
See Record
for more details about resource records.
Implementations§
source§impl<Name> RecordHeader<Name>
impl<Name> RecordHeader<Name>
source§impl<Name> RecordHeader<Name>
impl<Name> RecordHeader<Name>
sourcepub fn into_record<Data>(self, data: Data) -> Record<Name, Data>
pub fn into_record<Data>(self, data: Data) -> Record<Name, Data>
Converts the header into an actual record.
source§impl<Octs> RecordHeader<ParsedDname<Octs>>
impl<Octs> RecordHeader<ParsedDname<Octs>>
source§impl<'a, Octs: AsRef<[u8]> + ?Sized> RecordHeader<ParsedDname<&'a Octs>>
impl<'a, Octs: AsRef<[u8]> + ?Sized> RecordHeader<ParsedDname<&'a Octs>>
pub fn parse_ref(parser: &mut Parser<'a, Octs>) -> Result<Self, ParseError>
source§impl<Name> RecordHeader<Name>
impl<Name> RecordHeader<Name>
sourcepub fn parse_and_skip<'a, Octs>(
parser: &mut Parser<'a, Octs>
) -> Result<Self, ParseError>where
Self: Parse<'a, Octs>,
Octs: Octets,
pub fn parse_and_skip<'a, Octs>( parser: &mut Parser<'a, Octs> ) -> Result<Self, ParseError>where Self: Parse<'a, Octs>, Octs: Octets,
Parses a record header and then skips over the data.
If the function succeeds, the parser will be positioned right behind the end of the record.
source§impl<Octs> RecordHeader<ParsedDname<Octs>>
impl<Octs> RecordHeader<ParsedDname<Octs>>
sourcepub fn parse_into_record<'a, Src, Data>(
self,
parser: &mut Parser<'a, Src>
) -> Result<Option<Record<ParsedDname<Octs>, Data>>, ParseError>where
Src: AsRef<[u8]> + ?Sized,
Data: ParseRecordData<'a, Src>,
pub fn parse_into_record<'a, Src, Data>( self, parser: &mut Parser<'a, Src> ) -> Result<Option<Record<ParsedDname<Octs>, Data>>, ParseError>where Src: AsRef<[u8]> + ?Sized, Data: ParseRecordData<'a, Src>,
Parses the remainder of the record and returns it.
The method assumes that the parsers is currently positioned right
after the end of the record header. If the record data type D
feels capable of parsing a record with a header of self
, the
method will parse the data and return a full Record<D>
. Otherwise,
it skips over the record data.
source§impl<Name: ToDname> RecordHeader<Name>
impl<Name: ToDname> RecordHeader<Name>
pub fn compose<Target: Composer + ?Sized>( &self, buf: &mut Target ) -> Result<(), Target::AppendError>
pub fn compose_canonical<Target: Composer + ?Sized>( &self, buf: &mut Target ) -> Result<(), Target::AppendError>
Trait Implementations§
source§impl<Name: Clone> Clone for RecordHeader<Name>
impl<Name: Clone> Clone for RecordHeader<Name>
source§fn clone(&self) -> RecordHeader<Name>
fn clone(&self) -> RecordHeader<Name>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<Name: Debug> Debug for RecordHeader<Name>
impl<Name: Debug> Debug for RecordHeader<Name>
source§impl<Name: Hash> Hash for RecordHeader<Name>
impl<Name: Hash> Hash for RecordHeader<Name>
source§impl<Name: ToDname> Ord for RecordHeader<Name>
impl<Name: ToDname> Ord for RecordHeader<Name>
source§impl<Name, NName> PartialEq<RecordHeader<NName>> for RecordHeader<Name>where
Name: ToDname,
NName: ToDname,
impl<Name, NName> PartialEq<RecordHeader<NName>> for RecordHeader<Name>where Name: ToDname, NName: ToDname,
source§fn eq(&self, other: &RecordHeader<NName>) -> bool
fn eq(&self, other: &RecordHeader<NName>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<Name, NName> PartialOrd<RecordHeader<NName>> for RecordHeader<Name>where
Name: ToDname,
NName: ToDname,
impl<Name, NName> PartialOrd<RecordHeader<NName>> for RecordHeader<Name>where Name: ToDname, NName: ToDname,
source§fn partial_cmp(&self, other: &RecordHeader<NName>) -> Option<Ordering>
fn partial_cmp(&self, other: &RecordHeader<NName>) -> 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