Function length_value
fn length_value<I, E, F, G>(f: F, g: G) -> impl Parser<I, Output = <G as Parser<I>>::Output, Error = E>
where
I: Clone + Input,
<F as Parser<I>>::Output: ToUsize,
F: Parser<I, Error = E>,
G: Parser<I, Error = E>,
E: ParseError<I>
Gets a number from the first parser,
takes a subslice of the input of that size,
then applies the second parser on that subslice.
If the second parser returns Incomplete,
length_value will return an error.
Arguments
fThe parser to apply.gThe parser to apply on the subslice.
# use ;
use be_u16;
use length_value;
use tag;
assert_eq!;
assert_eq!;
assert_eq!;