Trait der::message::Message[][src]

pub trait Message<'a>: Decodable<'a> {
    fn fields<F, T>(&self, f: F) -> Result<T>
    where
        F: FnOnce(&[&dyn Encodable]) -> Result<T>
; }
Expand description

Messages encoded as an ASN.1 SEQUENCE.

The “message” pattern this trait provides is not an ASN.1 concept, but rather a pattern for writing ASN.1 DER decoders and encoders which map ASN.1 SEQUENCE types to Rust structs with a minimum of code.

Types which impl this trait receive blanket impls for the Decodable, Encodable, and Tagged traits.

Required methods

Call the provided function with a slice of Encodable trait objects representing the fields of this message.

This method uses a callback because structs with fields which aren’t directly Encodable may need to construct temporary values from their fields prior to encoding.

Implementors