rocket::mtls::x509::der_parser::asn1_rs::nom::combinator

Function not

Source
pub fn not<I, O, E, F>(parser: F) -> impl FnMut(I)
where I: Clone, E: ParseError<I>, F: Parser<I, O, E>,
Available on crate feature mtls only.
Expand description

Succeeds if the child parser returns an error.

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

let mut parser = not(alpha1);

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