Function bits
fn bits<Input, Output, BitError, ByteError, ParseNext>(parser: ParseNext) -> impl Parser<Input, Output, ByteError>
where
BitError: ParserError<(Input, usize)> + ErrorConvert<ByteError>,
ByteError: ParserError<Input>,
(Input, usize): Stream,
Input: Stream + Clone,
ParseNext: Parser<(Input, usize), Output, BitError>
Converts a byte-level input to a bit-level input
See bytes to convert it back.
Example
# use *;
# use Bytes;
# use ;
# use ContextError;
# use ErrMode;
type Stream<'i> = &'i Bytes;
let input = stream;
let output = parse.parse_peek.expect;
// The first byte is consumed, the second byte is partially consumed and dropped.
let remaining = output.0;
assert_eq!;
let parsed = output.1;
assert_eq!;
assert_eq!;