Trait asn1_cereal::ber::serial::traits::BerDeserialize [] [src]

pub trait BerDeserialize: Asn1Info + Sized {
    fn deserialize<I: Iterator<Item=Result<u8>>>(reader: &mut I) -> Result<Self, DecodeError> { ... }
    fn deserialize_enc<E: BerEncRules, I: Iterator<Item=Result<u8>>>(e: E, reader: &mut I) -> Result<Self, DecodeError> { ... }
    fn deserialize_with_tag<E: BerEncRules, I: Iterator<Item=Result<u8>>>(e: E, reader: &mut I, tag: Tag, len: Len) -> Result<Self, DecodeError> { ... }
    fn _deserialize_with_tag<E: BerEncRules, I: Iterator<Item=Result<u8>>>(e: E, reader: &mut I, tag: Tag, len: Len) -> Option<Result<Self, DecodeError>> { ... }
    fn deserialize_value<E: BerEncRules, I: Iterator<Item=Result<u8>>>(e: E, reader: &mut I, len: Len) -> Result<Self, DecodeError> { ... }
}

Provides the methods required to deserialize this Rust type from an ASN.1 stream.

When implementing this for a simple primitive type, implementing deserialize_value should be all that's required. For more complex, structued types you may need to implement _deserialize_with_tag (this is called first by `deserialize_with_tag).

Provided Methods

Deserialize ASN.1 data into a Rust value, accepting any valid BER.

Deserialize ASN.1 data into a Rust value, using a specific set of encoding rules.

Deserialize ASN.1 data into a Rust value, using a specific set of encoding rules, and also providing the decoded tag and length.

This function assumes the next bytes to decode are the BER length of this element.

An empty method that is called first by deserialize_with_tag to allow custom handling, without losing normal deserialization behaviour.

Return Some(..) to return that value, or None to use normal behaviour.

Deserialize an ASN.1 value from a BER stream, after having the tag and length decoded.

The data length must be explicitly passed to this function. For primitive types, an error will be returned if this length is Indefinite.

Implementors