[][src]Function combine::parser::byte::bytes

pub fn bytes<'a, 'b, I>(
    s: &'static [u8]
) -> impl Parser<Input = I, Output = &'a [u8]> where
    I: Stream<Item = u8, Range = &'b [u8]>,
    I::Error: ParseError<I::Item, I::Range, I::Position>, 

Parses the bytes s.

If you have a stream implementing RangeStream such as &[u8] you can also use the range parser which may be more efficient.

let result = bytes(&b"rust"[..])
    .parse(&b"rust"[..])
    .map(|x| x.0);
assert_eq!(result, Ok(&b"rust"[..]));