[][src]Enum der::ErrorKind

#[non_exhaustive]pub enum ErrorKind {
    Failed,
    Length {
        tag: Tag,
    },
    Noncanonical,
    Oid,
    Overflow,
    Overlength,
    TrailingData {
        decoded: Length,
        remaining: Length,
    },
    Truncated,
    Underlength {
        expected: Length,
        actual: Length,
    },
    UnexpectedTag {
        expected: Option<Tag>,
        actual: Tag,
    },
    UnknownTag {
        byte: u8,
    },
    Value {
        tag: Tag,
    },
}

Error type.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Failed

Operation failed due to previous error

Length

Incorrect length for a given field

Fields of Length

tag: Tag

Tag type of the value being decoded

Noncanonical

Message is not canonically encoded

Oid

Malformed OID

Overflow

Integer overflow occurred (library bug!)

Overlength

Message is longer than this library's internal limits support

TrailingData

Undecoded trailing data at end of message

Fields of TrailingData

decoded: Length

Length of the decoded data

remaining: Length

Total length of the remaining data left in the buffer

Truncated

Unexpected end-of-message/nested field when decoding

Underlength

Encoded message is shorter than the expected length (i.e. an Encodable impl on a particular type has a buggy encoded_len)

Fields of Underlength

expected: Length

Expected length

actual: Length

Actual length

UnexpectedTag

Unexpected tag

Fields of UnexpectedTag

expected: Option<Tag>

Tag the decoder was expecting (if there is a single such tag).

None if multiple tags are expected/allowed, but the actual tag does not match any of them.

actual: Tag

Actual tag encountered in the message

UnknownTag

Unknown/unsupported tag

Fields of UnknownTag

byte: u8

Raw byte value of the tag

Value

Unexpected value

Fields of Value

tag: Tag

Tag of the unexpected value

Implementations

impl ErrorKind[src]

pub fn at(self, position: Length) -> Error[src]

Annotate an ErrorKind with context about where it occurred, returning an error.

Trait Implementations

impl Clone for ErrorKind[src]

impl Copy for ErrorKind[src]

impl Debug for ErrorKind[src]

impl Display for ErrorKind[src]

impl Eq for ErrorKind[src]

impl Error for ErrorKind[src]

impl From<ErrorKind> for Error[src]

impl PartialEq<ErrorKind> for ErrorKind[src]

impl StructuralEq for ErrorKind[src]

impl StructuralPartialEq for ErrorKind[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.