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>>
§Parsing and Composing
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>
pub fn parse_and_skip<'a, Octs>( parser: &mut Parser<'a, Octs>, ) -> Result<Self, ParseError>
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>
pub fn parse_into_record<'a, Src, Data>( self, parser: &mut Parser<'a, Src>, ) -> Result<Option<Record<ParsedDname<Octs>, Data>>, ParseError>
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>
impl<Name, NName> PartialEq<RecordHeader<NName>> for RecordHeader<Name>
source§impl<Name, NName> PartialOrd<RecordHeader<NName>> for RecordHeader<Name>
impl<Name, NName> PartialOrd<RecordHeader<NName>> for RecordHeader<Name>
impl<Name: ToDname> Eq for RecordHeader<Name>
Auto Trait Implementations§
impl<Name> Freeze for RecordHeader<Name>where
Name: Freeze,
impl<Name> RefUnwindSafe for RecordHeader<Name>where
Name: RefUnwindSafe,
impl<Name> Send for RecordHeader<Name>where
Name: Send,
impl<Name> Sync for RecordHeader<Name>where
Name: Sync,
impl<Name> Unpin for RecordHeader<Name>where
Name: Unpin,
impl<Name> UnwindSafe for RecordHeader<Name>where
Name: 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
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
)