Struct bcder::Tag [−][src]
pub struct Tag(_);
Expand description
The tag of a BER encoded value.
Each BER encoded value starts with a sequence of one or more octets called
the identifier octets. They encode both the tag of the value as well as
whether the value uses primitive or constructed encoding. The Tag
type
represents the tag only. The distinction between primitive and constructed
encoding is captured by the decoder types Primitive
and
Constructed
instead.
The tag in turn consists of two parts: the class and the number – the
Tag
type includes both of them.
Limitations
We can only decode up to four identifier octets. That is, we only support tag numbers between 0 and 1fffff.
Implementations
The tag marking the end-of-value in an indefinite length value.
This is UNIVERSAL 0.
The tag for the BIT STRING type, UNIVERSAL 3.
The tag for the OCTET STRING type, UNIVERSAL 4.
The tag for the ObjectDescriptor type, UNIVERSAL 7.
The tag for the ENUMERATED type, UNIVERAL 10.
The tag for the EMBEDDED PDV type, UNIVERAL 11.
The tag for the UTF8String type, UNIVERSAL 12
The tag for the RELATIVE-OID type, UNIVERAL 13.
The tag for the NumericString type, UNIVERSAL 18.
The tag for the PrintableString type, UNIVERSAL 19.
The tag for the TeletexString type, UNIVERSAL 20.
The tag for the VideotexString type, UNIVERSAL 21.
The tag for the IA5String type, UNIVERSAL 22.
The tag for the GeneralizedType type, UNIVERAL 24.
The tag for the GraphicString type, UNIVERSAL 25.
The tag for the VisibleString type, UNIVERSAL 26.
The tag for the GeneralString type, UNIVERSAL 27.
The tag for the UniversalString type, UNIVERSAL 28.
The tag for the BMPString type, UNIVERSAL 29.
Creates a new tag in the universal class with the given tag number.
Panics
Currently, this function panics if the tag number is greater than
MAX_VAL_SPAN_3_OCTETS
.
Creates a new tag in the application class with the given tag number.
Panics
Currently, this function panics if the tag number is greater than
MAX_VAL_SPAN_3_OCTETS
.
Creates a new tag in the context specific class.
Panics
Currently, this function panics if the provided tag number is greater
than MAX_VAL_SPAN_3_OCTETS
.
Creates a new tag in the private class with the given tag number.
Panics
Currently, this function panics if the provided tag number is greater
than MAX_VAL_SPAN_3_OCTETS
.
Returns whether the tag is of the universal class.
Returns whether the tag is of the application class.
Returns whether the tag is of the context specific class.
Returns whether the tag is of the private class.
Takes a tag from the beginning of a source.
Upon success, returns both the tag and whether the value is constructed. If there are no more octets available in the source, an error is returned.
Takes a tag from the beginning of a resource if it matches this tag.
If there is no more data available in the source or if the tag is
something else, returns Ok(None)
. If the tag matches self
, returns
whether the value is constructed.
Returns the number of octets of the encoded form of the tag.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Tag
impl UnwindSafe for Tag
Blanket Implementations
Mutably borrows from an owned value. Read more