domain::base::rdata

Trait ParseAnyRecordData

source
pub trait ParseAnyRecordData<'a, Octs: ?Sized>: RecordData + Sized {
    // Required method
    fn parse_any_rdata(
        rtype: Rtype,
        parser: &mut Parser<'a, Octs>,
    ) -> Result<Self, ParseError>;
}
Expand description

A record data type that can parse and represent any type of record.

While ParseRecordData allows a type to signal that it doesn’t actually cover a certain record type, this trait is for types that can parse and represent record data of any type.

When implementing a type for this trait, keep in mind that some record types – specifically those defined by RFC 1035 – can contain compressed domain names. Thus, this trait cannot be implemented by UnknownRecordData which just takes the raw data uninterpreted.

Required Methods§

source

fn parse_any_rdata( rtype: Rtype, parser: &mut Parser<'a, Octs>, ) -> Result<Self, ParseError>

Parses the record data.

The record data is for a record of type rtype.

The parser is positioned at the beginning of the record data and is is limited to the length of the data. The function only needs to parse as much data as it needs. The caller has to make sure to deal with data remaining in the parser.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, Octs: Octets + ?Sized> ParseAnyRecordData<'a, Octs> for AllRecordData<Octs::Range<'a>, ParsedName<Octs::Range<'a>>>