pub fn complete<I, O, E, F>(f: F) -> impl FnMut(I)
Available on crate feature
mtls
only.Expand description
Transforms Incomplete into Error
.
use nom::bytes::streaming::take;
use nom::combinator::complete;
let mut parser = complete(take(5u8));
assert_eq!(parser("abcdefg"), Ok(("fg", "abcde")));
assert_eq!(parser("abcd"), Err(Err::Error(("abcd", ErrorKind::Complete))));