Skip to main content

DecodingKind

Enum DecodingKind 

Source
pub enum DecodingKind {
    InvalidEncoding,
    OutOfRange,
    Overflow,
    InvalidTag,
    Missing,
    Trailing,
    Unsupported,
}
Expand description

Which fault a decoder found in the data it refused, so a responder can name it (#1446). DecodingKind::reject_reason gives the Clause 18.9 Reject reason each kind draws when the data was a confirmed request.

Variants§

§

InvalidEncoding

Contents whose encoding isn’t valid for their datatype: a wrong length, an Unsigned of no octets or with padding a canonical field refuses, an unknown character set, a BIT STRING’s unused-bit count past 7, and the like. The kind Error::decoding makes.

§

OutOfRange

A value too large for its field’s width, or outside the range the production or service gives it.

§

Overflow

More than the decoder takes: a count of items past its limit, or a tag length past its sanity bound.

§

InvalidTag

A tag that doesn’t fit where it stands: another number, class or form than the member there needs, a closing tag that closes no open frame, a tag header that is itself malformed, or an opening tag nested deeper than the decoder walks.

§

Missing

The data ends, or the enclosing frame closes, where a required member or a frame’s closing tag is due: a member is missing.

§

Trailing

Octets are left after the last member of a value that must fill its input: arguments beyond those the production has.

§

Unsupported

A well-formed encoding the decoder doesn’t handle: a CharacterString in a character set it can’t convert (IBM/Microsoft DBCS, JIS X 0208 or UCS-4).

Implementations§

Source§

impl DecodingKind

Source

pub fn reject_reason(self) -> RejectReason

The Clause 18.9 Reject reason that names this fault in a confirmed request:

KindReject reason
InvalidEncodingINVALID_DATA_ENCODING
OutOfRangePARAMETER_OUT_OF_RANGE
OverflowBUFFER_OVERFLOW
InvalidTagINVALID_TAG
MissingMISSING_REQUIRED_PARAMETER
TrailingTOO_MANY_ARGUMENTS
UnsupportedOTHER

Trait Implementations§

Source§

impl Clone for DecodingKind

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 DecodingKind

Source§

impl Debug for DecodingKind

Source§

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

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

impl Eq for DecodingKind

Source§

impl Hash for DecodingKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for DecodingKind

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 DecodingKind

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<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, 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.