[][src]Trait domain::base::opt::ParseOptData

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

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

Required methods

fn parse_option(
    code: OptionCode,
    parser: &mut Parser<Octets>
) -> 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.

Loading content...

Implementors

impl<Octets, Ref> ParseOptData<Ref> for UnknownOptData<Octets> where
    Octets: AsRef<[u8]>,
    Ref: OctetsRef<Range = Octets>, 
[src]

impl<Octets, T> ParseOptData<Octets> for T where
    T: CodeOptData + Parse<Octets> + Compose + Sized
[src]

impl<Ref: OctetsRef> ParseOptData<Ref> for AllOptData<Ref::Range>[src]

Loading content...