Enum bcder::decode::Content [−][src]
pub enum Content<'a, S: 'a> {
Primitive(Primitive<'a, S>),
Constructed(Constructed<'a, S>),
}Expand description
The content octets of a BER-encoded value.
A value is either primitive, containing actual octets of an actual value, or constructed, in which case its content contains additional BER encoded values. This enum is useful for cases where a certain type may be encoded as either a primitive value or a complex constructed value.
Note that this type represents the content octets only, i.e., it does not contain the tag of the value.
Variants
Primitive(Primitive<'a, S>)The value is a primitive value.
Tuple Fields of Primitive
0: Primitive<'a, S>Constructed(Constructed<'a, S>)The value is a constructed value.
Tuple Fields of Constructed
0: Constructed<'a, S>Implementations
Returns whether this value is a primitive value.
Returns whether this value is a constructed value.
Converts a reference into into one to a primitive value or errors out.
Converts a reference into on to a constructed value or errors out.
Converts content into a u8.
If the content is not primitive or does not contain a single BER encoded INTEGER value between 0 and 256, returns a malformed error.
Skips over the content if it contains an INTEGER of value expected.
The content needs to be primitive and contain a validly encoded
integer of value expected or else a malformed error will be
returned.
Converts content into a u16.
If the content is not primitive or does not contain a single BER encoded INTEGER value between 0 and 2^16-1, returns a malformed error.
Converts content into a u32.
If the content is not primitive or does not contain a single BER encoded INTEGER value between 0 and 2^32-1, returns a malformed error.
Converts content into a u64.
If the content is not primitive or does not contain a single BER encoded INTEGER value between 0 and 2^64-1, returns a malformed error.