Trait domain::base::opt::ParseOptData
source · pub trait ParseOptData<'a, Octs: ?Sized>: OptData + Sized {
// Required method
fn parse_option(
code: OptionCode,
parser: &mut Parser<'a, Octs>
) -> Result<Option<Self>, ParseError>;
}
Expand description
An OPT option that can be parsed from the record data.
Required Methods§
sourcefn parse_option(
code: OptionCode,
parser: &mut Parser<'a, Octs>
) -> Result<Option<Self>, ParseError>
fn parse_option( code: OptionCode, parser: &mut Parser<'a, Octs> ) -> Result<Option<Self>, ParseError>
Parses the option code data.
The data is for an option of code
. The function may decide whether
it wants to parse data for that type. It should return Ok(None)
if
it doesn’t.
The parser
is positioned at the beginning of the option data and is
is limited to the length of the data. The method only needs to parse
as much data as it needs. The caller has to make sure to deal with
data remaining in the parser.
If the function doesn’t want to process the data, it must not touch the parser. In particual, it must not advance it.