Function der_parser::ber::parse_ber_content
source · pub fn parse_ber_content<'a>(
tag: BerTag
) -> impl Fn(&'a [u8], &BerObjectHeader<'_>, usize) -> BerResult<'a, BerObjectContent<'a>>
Expand description
Parse the next bytes as the content of a BER object (combinator)
Content type is not checked, caller is reponsible of providing the correct tag
Caller is also responsible to check if parsing function consumed the expected number of
bytes (header.len
).
The arguments of the parse function are: (input, ber_object_header, max_recursion)
.
Example: manually parsing header and content
let (i, header) = ber_read_element_header(bytes).expect("parsing failed");
let (rem, content) = parse_ber_content(header.tag)(i, &header, MAX_RECURSION)
.expect("parsing failed");