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§

source

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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, Octs> ParseOptData<'a, Octs> for Chain<Dname<Octs::Range<'a>>>
where Octs: Octets,

source§

impl<'a, Octs> ParseOptData<'a, Octs> for ExtendedError<Octs::Range<'a>>
where Octs: Octets + ?Sized,

source§

impl<'a, Octs> ParseOptData<'a, Octs> for UnknownOptData<Octs::Range<'a>>
where Octs: Octets + ?Sized,

source§

impl<'a, Octs: Octets + ?Sized> ParseOptData<'a, Octs> for Understood<DauVariant, Octs::Range<'a>>

source§

impl<'a, Octs: Octets + ?Sized> ParseOptData<'a, Octs> for Understood<DhuVariant, Octs::Range<'a>>

source§

impl<'a, Octs: Octets + ?Sized> ParseOptData<'a, Octs> for Understood<N3uVariant, Octs::Range<'a>>

source§

impl<'a, Octs: Octets> ParseOptData<'a, Octs> for AllOptData<Octs::Range<'a>, Dname<Octs::Range<'a>>>

source§

impl<'a, Octs: Octets> ParseOptData<'a, Octs> for KeyTag<Octs::Range<'a>>

source§

impl<'a, Octs: Octets> ParseOptData<'a, Octs> for Nsid<Octs::Range<'a>>

source§

impl<'a, Octs: Octets> ParseOptData<'a, Octs> for Padding<Octs::Range<'a>>

source§

impl<'a, Octs: AsRef<[u8]>> ParseOptData<'a, Octs> for Expire

source§

impl<'a, Octs: AsRef<[u8]>> ParseOptData<'a, Octs> for TcpKeepalive

source§

impl<'a, Octs: AsRef<[u8]>> ParseOptData<'a, Octs> for ClientSubnet