pub enum ASN1Type {
Show 22 variants
Null,
Boolean(Boolean),
Integer(Integer),
Real(Real),
BitString(BitString),
OctetString(OctetString),
CharacterString(CharacterString),
Enumerated(Enumerated),
Choice(Choice),
Sequence(SequenceOrSet),
SequenceOf(SequenceOrSetOf),
Set(SequenceOrSet),
SetOf(SequenceOrSetOf),
Time(Time),
GeneralizedTime(GeneralizedTime),
UTCTime(UTCTime),
ElsewhereDeclaredType(DeclarationElsewhere),
ChoiceSelectionType(ChoiceSelectionType),
ObjectIdentifier(ObjectIdentifier),
InformationObjectFieldReference(InformationObjectFieldReference),
EmbeddedPdv,
External,
}
Expand description
The possible types of an ASN1 data element.
In addition, the ElsewhereDeclaredType
enumeral denotes an type
specified in the same or an imported ASN1 specification.
Variants§
Null
Boolean(Boolean)
Integer(Integer)
Real(Real)
BitString(BitString)
OctetString(OctetString)
CharacterString(CharacterString)
Enumerated(Enumerated)
Choice(Choice)
Sequence(SequenceOrSet)
SequenceOf(SequenceOrSetOf)
Set(SequenceOrSet)
SetOf(SequenceOrSetOf)
Time(Time)
GeneralizedTime(GeneralizedTime)
UTCTime(UTCTime)
ElsewhereDeclaredType(DeclarationElsewhere)
ChoiceSelectionType(ChoiceSelectionType)
ObjectIdentifier(ObjectIdentifier)
InformationObjectFieldReference(InformationObjectFieldReference)
EmbeddedPdv
External
Implementations§
Source§impl ASN1Type
impl ASN1Type
pub fn as_str(&self) -> Cow<'_, str>
pub fn builtin_or_elsewhere( parent: Option<&str>, identifier: &str, constraints: Option<Vec<Constraint>>, ) -> ASN1Type
pub fn is_builtin_type(&self) -> bool
pub fn constraints(&self) -> Option<&Vec<Constraint>>
pub fn constraints_mut(&mut self) -> Option<&mut Vec<Constraint>>
Source§impl ASN1Type
impl ASN1Type
Sourcepub fn collect_supertypes(
&mut self,
tlds: &BTreeMap<String, ToplevelDefinition>,
) -> Result<(), GrammarError>
pub fn collect_supertypes( &mut self, tlds: &BTreeMap<String, ToplevelDefinition>, ) -> Result<(), GrammarError>
Collects supertypes of ASN1 values.
In ToplevelTypeDefinition
s, values will appear only as DEFAULT
values in SET
s or SEQUENCE
s.
pub fn has_choice_selection_type(&self) -> bool
pub fn link_choice_selection_type( &mut self, tlds: &BTreeMap<String, ToplevelDefinition>, ) -> Result<(), GrammarError>
pub fn contains_components_of_notation(&self) -> bool
pub fn link_components_of_notation( &mut self, tlds: &BTreeMap<String, ToplevelDefinition>, ) -> bool
pub fn link_constraint_reference( &mut self, name: &String, tlds: &BTreeMap<String, ToplevelDefinition>, ) -> Result<Option<ASN1Type>, GrammarError>
Sourcepub fn recurses(
&self,
name: &str,
tlds: &BTreeMap<String, ToplevelDefinition>,
reference_graph: Vec<&str>,
) -> bool
pub fn recurses( &self, name: &str, tlds: &BTreeMap<String, ToplevelDefinition>, reference_graph: Vec<&str>, ) -> bool
Checks if at any depth down the arbitrarily nested self
, an elsewhere declared type with the name name
exists.
Sequence Ofs and Set Ofs break the recursion tree, because they use heap-based data structures.
The reference_graph
serves to detect circular references in the recursion tree. If a circular reference is detected,
recursion detection is stopped. The circular reference will be marked recursive once the respective type is captured mutably in mark_recursive
.
Sourcepub fn mark_recursive(
&mut self,
name: &str,
tlds: &BTreeMap<String, ToplevelDefinition>,
) -> Result<Vec<Cow<'_, str>>, GrammarError>
pub fn mark_recursive( &mut self, name: &str, tlds: &BTreeMap<String, ToplevelDefinition>, ) -> Result<Vec<Cow<'_, str>>, GrammarError>
Traverses type and marks if recursive. Returns a vector of traversed type IDs since the last recursion detection or the leaf type.