pub trait AsnType {
const TAG: Tag;
const TAG_TREE: TagTree = _;
const CONSTRAINTS: Constraints = Constraints::NONE;
const IDENTIFIER: Identifier = Identifier::EMPTY;
const IS_CHOICE: bool = false;
// Provided method
fn is_present(&self) -> bool { ... }
}Expand description
A trait representing any type that can represented in ASN.1.
Required Associated Constants§
Sourceconst TAG: Tag
const TAG: Tag
The associated tag for the type.
Note When implementing CHOICE types, this should be set to
Tag::EOC and instead set the Self::TAG_TREE constant to contain
all variants.
Provided Associated Constants§
Sourceconst TAG_TREE: TagTree = _
const TAG_TREE: TagTree = _
The root of this type’s tree of tag’s if it a CHOICE type, otherwise its
Leaf that points Self::TAG.
Sourceconst CONSTRAINTS: Constraints = Constraints::NONE
const CONSTRAINTS: Constraints = Constraints::NONE
The set of constraints for values of the given type.
Sourceconst IDENTIFIER: Identifier = Identifier::EMPTY
const IDENTIFIER: Identifier = Identifier::EMPTY
Identifier of an ASN.1 type as specified in the original specification
if not identical with the identifier of Self
Provided Methods§
Sourcefn is_present(&self) -> bool
fn is_present(&self) -> bool
Whether the type is present with value. OPTIONAL fields are common in SEQUENCE or SET.
Custom implementation is only used for OPTIONAL type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl AsnType for &str
impl AsnType for &str
const TAG: Tag = Tag::UTF8_STRING
const IDENTIFIER: Identifier = Identifier::UTF8_STRING
Source§impl AsnType for bool
impl AsnType for bool
const TAG: Tag = Tag::BOOL
const IDENTIFIER: Identifier = Identifier::BOOL
Source§impl AsnType for f32
Available on crate feature f32 only.
impl AsnType for f32
f32 only.const TAG: Tag = Tag::REAL
const IDENTIFIER: Identifier = Identifier::REAL
Source§impl AsnType for f64
Available on crate feature f64 only.
impl AsnType for f64
f64 only.