pub type OptionsRaw<B, O> = RecordsRaw<B, O>;
Expand description
A not-yet-parsed sequence of options.
OptionsRaw
represents a not-yet-parsed and not-yet-validated sequence
of options, for example from an IPv4 or TCP header or an NDP packet.
OptionsRaw
uses RecordsRaw
under the hood.
Aliased Type§
struct OptionsRaw<B, O> { /* private fields */ }
Implementations
Source§impl<B, R> RecordsRaw<B, R>where
R: RecordsImplLayout<Context = ()>,
impl<B, R> RecordsRaw<B, R>where
R: RecordsImplLayout<Context = ()>,
Source§impl<B, R> RecordsRaw<B, R>where
R: for<'a> RecordsRawImpl<'a>,
B: SplitByteSlice,
impl<B, R> RecordsRaw<B, R>where
R: for<'a> RecordsRawImpl<'a>,
B: SplitByteSlice,
Sourcepub fn parse_raw_with_context<BV: BufferView<B>>(
bytes: &mut BV,
context: R::Context,
) -> MaybeParsed<Self, (B, R::Error)>
pub fn parse_raw_with_context<BV: BufferView<B>>( bytes: &mut BV, context: R::Context, ) -> MaybeParsed<Self, (B, R::Error)>
Raw-parses a sequence of records with a context.
See RecordsRaw::parse_raw_with_mut_context
for details on bytes
,
context
, and return value. parse_raw_with_context
just calls
parse_raw_with_mut_context
with a mutable reference to the context
which is passed by value to this function.
Sourcepub fn parse_raw_with_mut_context<BV: BufferView<B>>(
bytes: &mut BV,
context: &mut R::Context,
) -> MaybeParsed<Self, (B, R::Error)>
pub fn parse_raw_with_mut_context<BV: BufferView<B>>( bytes: &mut BV, context: &mut R::Context, ) -> MaybeParsed<Self, (B, R::Error)>
Raw-parses a sequence of records with a mutable context.
parse_raw_with_mut_context
shallowly parses bytes
as a sequence of
records. context
may be used by implementers to maintain state.
parse_raw_with_mut_context
performs a single pass over all of the
records to be able to find the end of the records list and update
bytes
accordingly. Upon return with MaybeParsed::Complete
,
bytes
will include only those bytes which are not part of the records
list. Upon return with MaybeParsed::Incomplete
, bytes
will still
contain the bytes which could not be parsed, and all subsequent bytes.
Source§impl<B, R> RecordsRaw<B, R>
impl<B, R> RecordsRaw<B, R>
Sourcepub fn parse_raw<BV: BufferView<B>>(
bytes: &mut BV,
) -> MaybeParsed<Self, (B, R::Error)>
pub fn parse_raw<BV: BufferView<B>>( bytes: &mut BV, ) -> MaybeParsed<Self, (B, R::Error)>
Raw-parses a sequence of records.
Equivalent to calling RecordsRaw::parse_raw_with_context
with
context = ()
.