[−][src]Struct domain::base::record::ParsedRecord
A raw record parsed from a message.
A value of this type contains the record header and the raw record data.
It is mainly used as an intermediary type when turning raw message data
into Record
s.
It allows access to the header only but can be traded for a real record
of a specific type of ParseRecordData
(i.e., some type that knowns
how to parse record data) via the to_record
and into_record
methods.
Implementations
impl<Ref> ParsedRecord<Ref>
[src]
pub fn new(header: RecordHeader<ParsedDname<Ref>>, data: Parser<Ref>) -> Self
[src]
Creates a new parsed record from a header and the record data.
The record data is provided via a parser that is positioned at the first byte of the record data.
pub fn owner(&self) -> &ParsedDname<Ref>
[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.
impl<Ref: OctetsRef> ParsedRecord<Ref>
[src]
pub fn to_record<Data>(
&self
) -> Result<Option<Record<ParsedDname<Ref>, Data>>, ParseError> where
Data: ParseRecordData<Ref>,
[src]
&self
) -> Result<Option<Record<ParsedDname<Ref>, Data>>, ParseError> where
Data: ParseRecordData<Ref>,
Creates a real resource record from the parsed record.
The method is generic over a type that knows how to parse record
data via the ParseRecordData
trait. The record data is given to
this trait for parsing. If the trait feels capable of parsing this
type of record (as indicated by the record type) and parsing succeeds,
the method returns Ok(Some(_))
. It returns Ok(None)
if the trait
doesn’t know how to parse this particular record type. It returns
an error if parsing fails.
pub fn into_record<Data>(
self
) -> Result<Option<Record<ParsedDname<Ref>, Data>>, ParseError> where
Data: ParseRecordData<Ref>,
[src]
self
) -> Result<Option<Record<ParsedDname<Ref>, Data>>, ParseError> where
Data: ParseRecordData<Ref>,
Trades the parsed record for a real resource record.
The method is generic over a type that knows how to parse record
data via the ParseRecordData
trait. The record data is given to
this trait for parsing. If the trait feels capable of parsing this
type of record (as indicated by the record type) and parsing succeeds,
the method returns Ok(Some(_))
. It returns Ok(None)
if the trait
doesn’t know how to parse this particular record type. It returns
an error if parsing fails.
Trait Implementations
impl<Ref: Clone> Clone for ParsedRecord<Ref>
[src]
fn clone(&self) -> ParsedRecord<Ref>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Ref: OctetsRef> Eq for ParsedRecord<Ref>
[src]
impl<Ref: OctetsRef> Parse<Ref> for ParsedRecord<Ref>
[src]
fn parse(parser: &mut Parser<Ref>) -> Result<Self, ParseError>
[src]
fn skip(parser: &mut Parser<Ref>) -> Result<(), ParseError>
[src]
impl<Ref, OtherRef> PartialEq<ParsedRecord<OtherRef>> for ParsedRecord<Ref> where
Ref: OctetsRef,
OtherRef: OctetsRef,
[src]
Ref: OctetsRef,
OtherRef: OctetsRef,
Auto Trait Implementations
impl<Ref> RefUnwindSafe for ParsedRecord<Ref> where
Ref: RefUnwindSafe,
Ref: RefUnwindSafe,
impl<Ref> Send for ParsedRecord<Ref> where
Ref: Send,
Ref: Send,
impl<Ref> Sync for ParsedRecord<Ref> where
Ref: Sync,
Ref: Sync,
impl<Ref> Unpin for ParsedRecord<Ref> where
Ref: Unpin,
Ref: Unpin,
impl<Ref> UnwindSafe for ParsedRecord<Ref> where
Ref: UnwindSafe,
Ref: 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>,