Skip to main content

ErrorCode

Enum ErrorCode 

Source
#[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
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.
§

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.

Trait Implementations§

Source§

impl Clone for ErrorCode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ErrorCode

Source§

impl Debug for ErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ErrorCode

Source§

impl From<MemoryError> for ErrorCode

Source§

fn from(reason: MemoryError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ErrorCode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ErrorCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.