Function oneof

Source
pub fn oneof(bytes: &[u8]) -> ByteLookupTable
Expand description

Returns a pattern that will match any byte in bytes at the start of the input

use bparse::{Pattern, oneof};

let pattern = oneof(b"?!.:");
assert_eq!(pattern.eval(b"hi"), None);
assert_eq!(pattern.eval(b"!!"), Some(1));
assert_eq!(pattern.eval(b":"), Some(1));