Function rocket::mtls::x509::der_parser::ber::parse_ber_set_of

source ·
pub fn parse_ber_set_of<'a, F>(f: F) -> impl FnMut(&'a [u8])
where F: Fn(&'a [u8]) -> Result<(&'a [u8], BerObject<'a>), Err<Error>>,
Available on crate feature mtls only.
Expand description

Parse a SET OF object

Given a subparser for a BER type, parse a set of identical objects.

/// Read a SET OF INTEGER
fn parser(i:&[u8]) -> BerResult<BerObject> {
    parse_ber_set_of(parse_ber_integer)(i)
}

let (rem, v) = parser(&bytes).expect("parsing failed");