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
sourceimpl<Name> RecordHeader<Name>
impl<Name> RecordHeader<Name>
sourceimpl<Name> RecordHeader<Name>
impl<Name> RecordHeader<Name>
sourcepub fn parse_and_skip<Ref>(parser: &mut Parser<Ref>) -> Result<Self, ParseError>where
Self: Parse<Ref>,
Ref: OctetsRef,
pub fn parse_and_skip<Ref>(parser: &mut Parser<Ref>) -> Result<Self, ParseError>where
Self: Parse<Ref>,
Ref: OctetsRef,
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.
sourceimpl<Ref: OctetsRef> RecordHeader<ParsedDname<Ref>>
impl<Ref: OctetsRef> RecordHeader<ParsedDname<Ref>>
sourcepub fn parse_into_record<Data>(
self,
parser: &mut Parser<Ref>
) -> Result<Option<Record<ParsedDname<Ref>, Data>>, ParseError>where
Data: ParseRecordData<Ref>,
pub fn parse_into_record<Data>(
self,
parser: &mut Parser<Ref>
) -> Result<Option<Record<ParsedDname<Ref>, Data>>, ParseError>where
Data: ParseRecordData<Ref>,
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.
sourceimpl<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.
Trait Implementations
sourceimpl<Name: Clone> Clone for RecordHeader<Name>
impl<Name: Clone> Clone for RecordHeader<Name>
sourcefn clone(&self) -> RecordHeader<Name>
fn clone(&self) -> RecordHeader<Name>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<Name: Compose> Compose for RecordHeader<Name>
impl<Name: Compose> Compose for RecordHeader<Name>
sourcefn compose<T: OctetsBuilder + AsMut<[u8]>>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
fn compose<T: OctetsBuilder + AsMut<[u8]>>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
Appends the concrete representation of the value to the target. Read more
sourcefn compose_canonical<T: OctetsBuilder + AsMut<[u8]>>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
fn compose_canonical<T: OctetsBuilder + AsMut<[u8]>>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
Appends the canonical representation of the value to the target. Read more
sourceimpl<Name: Debug> Debug for RecordHeader<Name>
impl<Name: Debug> Debug for RecordHeader<Name>
sourceimpl<'de, Name> Deserialize<'de> for RecordHeader<Name>where
Name: Deserialize<'de>,
impl<'de, Name> Deserialize<'de> for RecordHeader<Name>where
Name: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<Name: Hash> Hash for RecordHeader<Name>
impl<Name: Hash> Hash for RecordHeader<Name>
sourceimpl<Name: ToDname> Ord for RecordHeader<Name>
impl<Name: ToDname> Ord for RecordHeader<Name>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<Ref: OctetsRef> Parse<Ref> for RecordHeader<ParsedDname<Ref>>
impl<Ref: OctetsRef> Parse<Ref> for RecordHeader<ParsedDname<Ref>>
sourceimpl<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,
sourcefn eq(&self, other: &RecordHeader<NName>) -> bool
fn eq(&self, other: &RecordHeader<NName>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl<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,
sourcefn partial_cmp(&self, other: &RecordHeader<NName>) -> Option<Ordering>
fn partial_cmp(&self, other: &RecordHeader<NName>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<Name> Serialize for RecordHeader<Name>where
Name: Serialize,
impl<Name> Serialize for RecordHeader<Name>where
Name: Serialize,
impl<Name: ToDname> Eq for RecordHeader<Name>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
sourcefn octets_into(self) -> Result<Target, ShortBuf>
fn octets_into(self) -> Result<Target, ShortBuf>
Performs the conversion.