Derive Macro der::Message [−][src]
#[derive(Message)] { // Attributes available to this derive: #[asn1] }
This is supported on crate feature
derive
only.Derive the Message
trait on a struct.
This custom derive macro can be used to automatically impl the
Message
trait for any struct representing a message which is
encoded as an ASN.1 SEQUENCE
.
Usage
ⓘ
use der::{Any, Message, ObjectIdentifier}; /// X.509 `AlgorithmIdentifier` #[derive(Message)] pub struct AlgorithmIdentifier<'a> { /// This field contains an ASN.1 `OBJECT IDENTIFIER`, a.k.a. OID. pub algorithm: ObjectIdentifier, /// This field is `OPTIONAL` and contains the ASN.1 `ANY` type, which /// in this example allows arbitrary algorithm-defined parameters. pub parameters: Option<Any<'a>> }
#[asn1(type = "...")]
attribute
See toplevel documentation for the der_derive
crate for more
information about the #[asn1]
attribute.