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 BOOLEAN type, UNIVERSAL 1.

The tag for the INTEGER type, UNIVERSAL 2.

The tag for the BIT STRING type, UNIVERSAL 3.

The tag for the OCTET STRING type, UNIVERSAL 4.

The tag for the NULL type, UNIVERSAL 5.

The tag for the OBJECT IDENTIFIER type, UNIVERSAL 6.

The tag for the ObjectDescriptor type, UNIVERSAL 7.

The tag for the EXTERNAL and Instance-of types, UNIVERSAL 8.

The tag for the REAL type, UNIVERSAL 9.

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 SEQUENCE and SEQUENCE OF types, UNIVERSAL 16.

The tag for the SET and SET OF types, UNIVERSAL 17.

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 UTCTime type, UNIVERSAL 23.

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.

The tag context specific tag [0].

The tag context specific tag [1].

The tag context specific tag [2].

The tag context specific tag [3].

The tag context specific tag [4].

The tag context specific tag [5].

The tag context specific tag [6].

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.

Returns the number of the tag.

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.

Encodes the tag into a target.

If constructed is true, the encoded tag will signal a value in constructed encoding and primitive encoding otherwise.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.