Enum der::ErrorKind [−][src]
#[non_exhaustive] pub enum ErrorKind {}Show variants
DuplicateField { tag: Tag, }, Failed, Length { tag: Tag, }, Noncanonical { tag: Tag, }, MalformedOid, Overflow, Overlength, TrailingData { decoded: Length, remaining: Length, }, Truncated, Underlength { expected: Length, actual: Length, }, UnexpectedTag { expected: Option<Tag>, actual: Tag, }, UnknownOid { oid: ObjectIdentifier, }, UnknownTag { byte: u8, }, Utf8(Utf8Error), Value { tag: Tag, },
Expand description
Error type.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Indicates a field which is duplicated when only one is expected.
Show fields
Fields of DuplicateField
tag: Tag
Tag of the duplicated field.
This error indicates a previous DER parsing operation resulted in
an error and tainted the state of a Decoder
or Encoder
.
Once this occurs, the overall operation has failed and cannot be subsequently resumed.
Incorrect length for a given field.
Show fields
Fields of Length
tag: Tag
Tag of the value being decoded.
Message is not canonically encoded.
Show fields
Fields of Noncanonical
tag: Tag
Tag of the value which is not canonically encoded.
Malformed OID
Integer overflow occurred (library bug!).
Message is longer than this library’s internal limits support.
Undecoded trailing data at end of message.
Show fields
Unexpected end-of-message/nested field when decoding.
Encoded message is shorter than the expected length.
(i.e. an Encodable
impl on a particular type has a buggy encoded_len
)
Unexpected tag.
Show fields
oid
only.Unknown OID.
This error is intended to be used by libraries which parse DER-based formats which encounter unknown or unsupported OID libraries.
It enables passing back the OID value to the caller, which allows them to determine which OID(s) are causing the error (and then potentially contribute upstream support for algorithms they care about).
Show fields
Fields of UnknownOid
oid: ObjectIdentifier
OID value that was unrecognized by a parser for a DER-based format.
Unknown/unsupported tag.
Show fields
Fields of UnknownTag
byte: u8
Raw byte value of the tag.
Utf8(Utf8Error)
UTF-8 errors.
Unexpected value.
Show fields
Fields of Value
tag: Tag
Tag of the unexpected value.
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ErrorKind
impl UnwindSafe for ErrorKind
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self