Derive Macro rasn_derive::AsnType
source · #[derive(AsnType)]
{
// Attributes available to this derive:
#[rasn]
}
Expand description
An automatic derive of the AsnType
trait.
This macro will automatically generate an implementation of AsnType
,
and generate a compile-time check that all of your fields (if struct) or
variants (if a choice style enum) have distinct tags.
§Shared Attributes
These attributes are available on containers, variants, and fields.
tag([class], number)
— override the default tag with the one specified with this attribute. E.g.#[rasn(tag(context, 0))]
, you can also wrapp[class], number
inexplicit
to mark it as a explicit tag (e.g.#[rasn(tag(explicit(0)))]
.)
§Container Attributes
crate_root
The path to therasn
library to use in the macro.enumerated/choice
Use either#[rasn(choice)]
or#[rasn(enumerated)]
delegate
Only available for newtype wrappers (e.g.struct Delegate(T)
); uses the innerT
type for implementing the trait.