Enum der::ErrorKind [−][src]
#[non_exhaustive]
pub enum ErrorKind {
Show variants
Failed,
Length {
tag: Tag,
},
Noncanonical,
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
Expand description
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.
Expand description
Incorrect length for a given field.
Show fields
Fields of Length
tag: TagExpand description
Tag type of the value being decoded.
Expand description
Message is not canonically encoded.
Expand description
Malformed OID
Expand description
Integer overflow occurred (library bug!).
Expand description
Message is longer than this library’s internal limits support.
Expand description
Undecoded trailing data at end of message.
Show fields
Expand description
Unexpected end-of-message/nested field when decoding.
Expand description
Encoded message is shorter than the expected length.
(i.e. an Encodable impl on a particular type has a buggy encoded_len)
Show fields
Expand description
Unexpected tag.
Show fields
oid only.Expand description
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: ObjectIdentifierExpand description
OID value that was unrecognized by a parser for a DER-based format.
Expand description
Unknown/unsupported tag.
Show fields
Fields of UnknownTag
byte: u8Expand description
Raw byte value of the tag.
Utf8(Utf8Error)Expand description
UTF-8 errors.
Expand description
Unexpected value.
Show fields
Fields of Value
tag: TagExpand description
Tag of the unexpected value.
Implementations
Trait Implementations
impl Error for ErrorKind[src]
impl Error for ErrorKind[src]fn source(&self) -> Option<&(dyn Error + 'static)>1.30.0[src]
fn source(&self) -> Option<&(dyn Error + 'static)>1.30.0[src]The lower-level source of this error, if any. Read more
fn backtrace(&self) -> Option<&Backtrace>[src]
fn backtrace(&self) -> Option<&Backtrace>[src]backtrace)Returns a stack backtrace, if available, of where this error occurred. Read more
fn description(&self) -> &str1.0.0[src]
fn description(&self) -> &str1.0.0[src]use the Display impl or to_string()
impl Copy for ErrorKind[src]
impl Eq for ErrorKind[src]
impl StructuralEq for ErrorKind[src]
impl StructuralPartialEq for ErrorKind[src]
Auto Trait Implementations
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnwindSafe for ErrorKind
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more