Function nom::combinator::all_consuming[][src]

pub fn all_consuming<I, O, E: ParseError<I>, F>(
    f: F
) -> impl Fn(I) -> IResult<I, O, E> where
    I: InputLength,
    F: Fn(I) -> IResult<I, O, E>, 

succeeds if all the input has been consumed by its child parser

use nom::combinator::all_consuming;
use nom::character::complete::alpha1;

let parser = all_consuming(alpha1);

assert_eq!(parser("abcd"), Ok(("", "abcd")));
assert_eq!(parser("abcd;"),Err(Err::Error((";", ErrorKind::Eof))));
assert_eq!(parser("123abcd;"),Err(Err::Error(("123abcd;", ErrorKind::Alpha))));