Function utils::parser::byte_range

source ·
pub fn byte_range(range: RangeInclusive<u8>) -> ByteRange
Expand description

Parser that consumes a single byte in the supplied range.

See also number_range and byte.

§Examples

assert_eq!(
    parser::byte_range(b'a'..=b'z').parse(b"hello world"),
    Ok((b'h', &b"ello world"[..]))
);