pub trait ParseOptData<Octets>: OptData {
    fn parse_option(
        code: OptionCode,
        parser: &mut Parser<Octets>
    ) -> Result<Option<Self>, ParseError>; }
Expand description

An OPT option that can be parsed from the record data.

Required Methods

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.

Implementors