rocket::mtls::oid::asn1_rs::nom::combinator

Function complete

Source
pub fn complete<I, O, E, F>(f: F) -> impl FnMut(I)
where I: Clone, E: ParseError<I>, F: Parser<I, O, E>,
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))));