#[non_exhaustive]pub enum ErrorCode {
Show 21 variants
UnexpectedEnd,
MalformedTag,
TagTooLarge,
LengthNotMinimal,
LengthTooLarge,
OffsetTooLarge,
IndefiniteLengthNotAllowed,
UnterminatedContents,
MalformedEndOfContents,
WrongConstruction,
UnexpectedTag,
IntegerNotMinimal,
IntegerEmpty,
MalformedOid,
MalformedBitString,
MalformedBoolean,
MalformedNull,
MalformedReal,
LimitExceeded(Limit),
AllocatorExhausted,
CapacityOverflow,
}Expand description
Why a parse stopped.
Malformed input is a statement about the bytes. A spent budget is a statement about this run, and the two must not be confused.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnexpectedEnd
The element claims more bytes than the enclosing element has left.
MalformedTag
A tag number was encoded with a leading zero byte, or does not end.
TagTooLarge
A tag number too large to represent.
LengthNotMinimal
A definite length was not encoded in the fewest bytes DER allows.
LengthTooLarge
A length too large to represent as an offset on this target.
OffsetTooLarge
An offset that would not fit, given where this window starts.
IndefiniteLengthNotAllowed
An indefinite length where the schema requires a definite one.
UnterminatedContents
An indefinite-length element that never reached its end-of-contents.
MalformedEndOfContents
End-of-contents was encoded with a non-zero length.
WrongConstruction
A primitive element encoded as constructed, or the reverse.
UnexpectedTag
The element is not the one the schema asked for.
IntegerNotMinimal
An integer with a redundant leading 0x00 or 0xff byte.
IntegerEmpty
An integer with no content bytes at all.
MalformedOid
An object identifier that is empty, ends mid-arc, or pads an arc.
MalformedBitString
A bit string with no count of padding bits, a count above seven, or, under DER, padding bits that are not zero.
MalformedBoolean
A boolean of the wrong length, or, under DER, a true that is not 0xff.
MalformedNull
A null with contents.
MalformedReal
A real whose octets are not a value of the type: a reserved base or number representation, a part written in more octets than it needs, or a mantissa the normalization forbids.
LimitExceeded(Limit)
The work this input asks for is more than the caller allowed.
Distinct from every code above on purpose: nothing is wrong with the input, and reporting it as malformed would tell somebody their document is broken when the truth is that this device declined to finish.
AllocatorExhausted
The allocator could not supply storage, independently of configured limits.
CapacityOverflow
A requested allocation’s capacity cannot be represented on this target.