Trait der::asn1::Choice

source ·
pub trait Choice<'a>: Decode<'a> + Tagged {
    // Required method
    fn can_decode(tag: Tag) -> bool;
}
Expand description

ASN.1 CHOICE denotes a union of one or more possible alternatives.

The types MUST have distinct tags.

This crate models choice as a trait, with a blanket impl for all types which impl Decode + FixedTag (i.e. they are modeled as a CHOICE with only one possible variant)

Required Methods§

source

fn can_decode(tag: Tag) -> bool

Is the provided Tag decodable as a variant of this CHOICE?

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Choice<'_> for Any

source§

impl<'a> Choice<'a> for AnyRef<'a>

source§

impl<'a, T> Choice<'a> for ContextSpecific<T>
where T: Decode<'a> + Tagged,

source§

impl<'a, T> Choice<'a> for T
where T: Decode<'a> + FixedTag,

This blanket impl allows any Tagged type to function as a Choice with a single alternative.