Enum der::ErrorKind [−][src]
#[non_exhaustive] pub enum ErrorKind {}Show 15 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.
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.
Fields of Length
tag: Tag
Tag of the value being decoded.
Message is not canonically encoded.
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.
Fields of TrailingData
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.
Fields of UnexpectedTag
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).
Fields of UnknownOid
oid: ObjectIdentifier
OID value that was unrecognized by a parser for a DER-based format.
Unknown/unsupported tag.
Fields of UnknownTag
byte: u8
Raw byte value of the tag.
UTF-8 errors.
Tuple Fields of Utf8
0: Utf8Error
Unexpected value.
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