[−][src]Trait domain::base::opt::ParseOptData
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>
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.
Implementors
impl<Octets, Ref> ParseOptData<Ref> for UnknownOptData<Octets> where
Octets: AsRef<[u8]>,
Ref: OctetsRef<Range = Octets>,
[src]
Octets: AsRef<[u8]>,
Ref: OctetsRef<Range = Octets>,
fn parse_option(
code: OptionCode,
parser: &mut Parser<Ref>
) -> Result<Option<Self>, ParseError>
[src]
code: OptionCode,
parser: &mut Parser<Ref>
) -> Result<Option<Self>, ParseError>
impl<Octets, T> ParseOptData<Octets> for T where
T: CodeOptData + Parse<Octets> + Compose + Sized,
[src]
T: CodeOptData + Parse<Octets> + Compose + Sized,
fn parse_option(
code: OptionCode,
parser: &mut Parser<Octets>
) -> Result<Option<Self>, ParseError>
[src]
code: OptionCode,
parser: &mut Parser<Octets>
) -> Result<Option<Self>, ParseError>
impl<Ref: OctetsRef> ParseOptData<Ref> for AllOptData<Ref::Range>
[src]
fn parse_option(
code: OptionCode,
parser: &mut Parser<Ref>
) -> Result<Option<Self>, ParseError>
[src]
code: OptionCode,
parser: &mut Parser<Ref>
) -> Result<Option<Self>, ParseError>