[−][src]Trait domain_core::bits::rdata::ParseRecordData
A record data type that can be parsed from a message.
When record data types are generic – typically over a domain name type –, they may not in all cases be parseable. They may still represent record data to be used when constructing the message.
To reflect this asymmetry, parsing of record data has its own trait.
Associated Types
Loading content...Required methods
fn parse_data(
rtype: Rtype,
parser: &mut Parser,
rdlen: usize
) -> Result<Option<Self>, Self::Err>
rtype: Rtype,
parser: &mut Parser,
rdlen: usize
) -> Result<Option<Self>, Self::Err>
Parses the record data.
The record data is for a record of type rtype
. The function may
decide whether it wants to parse data for that type. It should return
Ok(None)
if it doesn’t. The data is rdlen
bytes long and starts
at the current position of parser
. There is no guarantee that the
parser will have rdlen
bytes left. If it doesn’t, the function
should produce an error.
If the function doesn’t want to process the data, it must not touch the parser. In particual, it must not advance it.
Implementors
impl ParseRecordData for AllRecordData<ParsedDname>
[src]
type Err = AllDataParseError
fn parse_data(
rtype: Rtype,
parser: &mut Parser,
rdlen: usize
) -> Result<Option<Self>, Self::Err>
[src]
rtype: Rtype,
parser: &mut Parser,
rdlen: usize
) -> Result<Option<Self>, Self::Err>
impl ParseRecordData for MasterRecordData<ParsedDname>
[src]
type Err = MasterDataParseError
fn parse_data(
rtype: Rtype,
parser: &mut Parser,
rdlen: usize
) -> Result<Option<Self>, Self::Err>
[src]
rtype: Rtype,
parser: &mut Parser,
rdlen: usize
) -> Result<Option<Self>, Self::Err>
impl ParseRecordData for UnknownRecordData
[src]
type Err = ShortBuf
fn parse_data(
rtype: Rtype,
parser: &mut Parser,
rdlen: usize
) -> Result<Option<Self>, Self::Err>
[src]
rtype: Rtype,
parser: &mut Parser,
rdlen: usize
) -> Result<Option<Self>, Self::Err>