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

Function eof

Source
pub fn eof<I, E>(input: I) -> Result<(I, I), Err<E>>
where I: InputLength + Clone, E: ParseError<I>,
Available on crate feature mtls only.
Expand description

returns its input if it is at the end of input data

When we’re at the end of the data, this combinator will succeed


let parser = eof;
assert_eq!(parser("abc"), Err(Err::Error(("abc", ErrorKind::Eof))));
assert_eq!(parser(""), Ok(("", "")));