Function der_parser::der::parse_der_implicit[][src]

pub fn parse_der_implicit<'a, Tag, F>(
    i: &'a [u8],
    tag: Tag,
    f: F
) -> DerResult<'a> where
    F: Fn(&'a [u8], &DerObjectHeader<'_>, usize) -> BerResult<'a, DerObjectContent<'a>>,
    Tag: Into<DerTag>, 
Expand description

Parse an implicit tagged object, applying function to read content

Note: unlike explicit tagged functions, the callback must be a content parsing function, often based on the parse_der_content combinator.

The built object will use the original header (and tag), so the content may not match the tag value.

For a combinator version, see parse_der_tagged_implicit.

For a generic version (different output and error types), see parse_der_tagged_implicit_g.

Examples

The following parses [3] IMPLICIT INTEGER into a DerObject:

fn parse_int_implicit(i:&[u8]) -> DerResult {
    parse_der_implicit(
        i,
        3,
        parse_der_content(DerTag::Integer),
    )
}

let res = parse_int_implicit(bytes);