Function length_and_then
fn length_and_then<Input, Output, Count, Error, CountParser, ParseNext>(count: CountParser, parser: ParseNext) -> impl Parser<Input, Output, Error>
where
Input: StreamIsPartial + Stream + UpdateSlice + Clone,
Count: ToUsize,
CountParser: Parser<Input, Count, Error>,
ParseNext: Parser<Input, Output, Error>,
Error: ParserError<Input>
Parse a length-prefixed slice (TLV)
Complete version: Returns an error if there is not enough input data.
[Partial version][crate::_topic::partial]: Will return Err(winnow::error::ErrMode::Incomplete(_)) if there is not enough data.
Example
# use ;
# use *;
use Bytes;
use be_u16;
use length_and_then;
type Stream<'i> = ;
assert_eq!;
assert!;
assert_eq!;