take_while1

Function take_while1 

Source
pub fn take_while1(f: fn(&u8) -> bool) -> TakeWhile<1>
Expand description

Leaf parser for non-empty substrings 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());