Function utils::parser::take_while1
source · pub fn take_while1(f: fn(_: &u8) -> bool) -> TakeWhile<1>
Expand description
Parser for non-empty substrings consisting of bytes matching the provided function.
§Examples
let parser = parser::take_while1(u8::is_ascii_lowercase);
assert_eq!(
parser.parse(b"abc def"),
Ok((&b"abc"[..], &b" def"[..]))
);
assert!(parser.parse(b"ABC").is_err());