pub struct ParsedRecord<Ref> { /* private fields */ }
Expand description

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 Records.

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

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.

Returns a reference to the owner of the record.

Returns the record type of the record.

Returns the class of the record.

Returns the TTL of the record.

Returns the data length of the record.

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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Extracts a value from the beginning of parser. Read more

Skips over a value of this type at the beginning of parser. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.