Lines Matching defs:bytes
30 /// let output = parse(input).expect("We take 1.5 bytes and the input is longer than 2 bytes");
50 // The parser functions might already slice away all fully read bytes.
61 /// Counterpart to `bits`, `bytes` transforms its bit stream input into a byte slice for the underlying
68 /// use nom::bits::{bits, bytes, streaming::take};
78 /// bytes::<_, _, Error<&[u8]>, _, _>(rest)
86 pub fn bytes<I, O, E1, E2, P>(mut parser: P) -> impl FnMut((I, usize)) -> IResult<(I, usize), O, E2>
121 /// Take the `bits` function and assert that remaining bytes are correctly returned, if the
122 /// previous bytes are fully consumed
132 let output = result.expect("We take 2 bytes and the input is longer than 2 bytes");
144 /// Take the `bits` function and assert that remaining bytes are correctly returned, if the
145 /// previous bytes are NOT fully consumed. Partially consumed bytes are supposed to be dropped.
146 /// I.e. if we consume 1.5 bytes of 4 bytes, 2 bytes will be returned, bits 13-16 will be
155 let output = result.expect("We take 1.5 bytes and the input is longer than 2 bytes");
167 /// Ensure that in Incomplete error is thrown, if too few bytes are passed for a given parser.
177 assert_eq!("Parsing requires 2 bytes/chars", error.to_string());