[][src]Module bcder::decode

Parsing BER-encoded data.

This modules provides the means to parse BER-encoded data.

The basic idea is that for each type a function exists that knows how to decode one value of that type. For constructed types, this function in turn relies on similar functions provided for its consituent types. For a detailed introduction to how to write these functions, please refer to the decode section of the guide.

The two most important types of this module are Primitive and Constructed, representing the content octets of a value in primitive and constructed encoding, respectively. Each provides a number of methods allowing to parse the content.

You will never create a value of either type. Rather, you get handed a reference to one as an argument to a closure or function argument to be provided to these methods.

The enum Content is used for cases where a value can be either primitive or constructed such as most string types.

Decoding is jumpstarted by providing a data source to parse data from. This is any value that implements the Source trait.

Re-exports

pub use self::error::Error::Malformed;
pub use self::error::Error::Unimplemented;

Structs

CaptureSource

A source that captures what has been advanced over.

Constructed

The content octets of a constructed value.

LimitedSource

A source that can be limited to a certain number of octets.

Primitive

The content octets of a primitive value.

Enums

Content

The content octets of a BER-encoded value.

Error

An error happened while decoding data.

Traits

Source

A view into a sequence of octets.