Function nom::combinator::complete[][src]

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

transforms Incomplete into Error

use nom::bytes::streaming::take;
use nom::combinator::complete;

let parser = complete(take(5u8));

assert_eq!(parser("abcdefg"), Ok(("fg", "abcde")));
assert_eq!(parser("abcd"), Err(Err::Error(("abcd", ErrorKind::Complete))));