[−][src]Struct domain::base::record::RecordHeader
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
impl<Name> RecordHeader<Name>
[src]
pub fn new(
owner: Name,
rtype: Rtype,
class: Class,
ttl: u32,
rdlen: u16
) -> Self
[src]
owner: Name,
rtype: Rtype,
class: Class,
ttl: u32,
rdlen: u16
) -> Self
Creates a new record header from its components.
impl<Name> RecordHeader<Name>
[src]
pub fn parse_and_skip<Ref>(parser: &mut Parser<Ref>) -> Result<Self, ParseError> where
Self: Parse<Ref>,
Ref: OctetsRef,
[src]
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.
impl<Ref: OctetsRef> RecordHeader<ParsedDname<Ref>>
[src]
pub fn parse_into_record<Data>(
self,
parser: &mut Parser<Ref>
) -> Result<Option<Record<ParsedDname<Ref>, Data>>, ParseError> where
Data: ParseRecordData<Ref>,
[src]
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.
impl<Name> RecordHeader<Name>
[src]
pub fn owner(&self) -> &Name
[src]
Returns a reference to the owner of the record.
pub fn rtype(&self) -> Rtype
[src]
Returns the record type of the record.
pub fn class(&self) -> Class
[src]
Returns the class of the record.
pub fn ttl(&self) -> u32
[src]
Returns the TTL of the record.
pub fn rdlen(&self) -> u16
[src]
Returns the data length of the record.
pub fn into_record<Data>(self, data: Data) -> Record<Name, Data>
[src]
Converts the header into an actual record.
Trait Implementations
impl<Name: Clone> Clone for RecordHeader<Name>
[src]
fn clone(&self) -> RecordHeader<Name>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Name: Compose> Compose for RecordHeader<Name>
[src]
fn compose<T: OctetsBuilder>(&self, target: &mut T) -> Result<(), ShortBuf>
[src]
fn compose_canonical<T: OctetsBuilder>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
[src]
&self,
target: &mut T
) -> Result<(), ShortBuf>
impl<Name: Debug> Debug for RecordHeader<Name>
[src]
impl<Name: ToDname> Eq for RecordHeader<Name>
[src]
impl<Name: Hash> Hash for RecordHeader<Name>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<Name: ToDname> Ord for RecordHeader<Name>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<Ref: OctetsRef> Parse<Ref> for RecordHeader<ParsedDname<Ref>>
[src]
fn parse(parser: &mut Parser<Ref>) -> Result<Self, ParseError>
[src]
fn skip(parser: &mut Parser<Ref>) -> Result<(), ParseError>
[src]
impl<Name, NName> PartialEq<RecordHeader<NName>> for RecordHeader<Name> where
Name: ToDname,
NName: ToDname,
[src]
Name: ToDname,
NName: ToDname,
fn eq(&self, other: &RecordHeader<NName>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<Name, NName> PartialOrd<RecordHeader<NName>> for RecordHeader<Name> where
Name: ToDname,
NName: ToDname,
[src]
Name: ToDname,
NName: ToDname,
Auto Trait Implementations
impl<Name> RefUnwindSafe for RecordHeader<Name> where
Name: RefUnwindSafe,
Name: RefUnwindSafe,
impl<Name> Send for RecordHeader<Name> where
Name: Send,
Name: Send,
impl<Name> Sync for RecordHeader<Name> where
Name: Sync,
Name: Sync,
impl<Name> Unpin for RecordHeader<Name> where
Name: Unpin,
Name: Unpin,
impl<Name> UnwindSafe for RecordHeader<Name> where
Name: UnwindSafe,
Name: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,