Skip to main content

DecodeErrorKind

Enum DecodeErrorKind 

Source
pub enum DecodeErrorKind {
Show 21 variants UnexpectedEof, InvalidMagic, UnsupportedVersion { found: u32, }, Leb128TooLong, Leb128Overflow, UnknownSectionId { id: u8, }, SectionOverflow, SectionOutOfOrder { prev: u8, current: u8, }, DuplicateSection { id: u8, }, UnknownValType { byte: u8, }, UnknownRefType { byte: u8, }, UnknownImportDesc { byte: u8, }, UnknownExportDesc { byte: u8, }, InvalidMutability { byte: u8, }, InvalidUtf8, FunctionCodeLengthMismatch { functions: u32, codes: u32, }, TooManyLocals, UnknownOpcode { byte: u8, }, UnknownSimdOpcode { opcode: u32, }, UnexpectedByte { expected: u8, found: u8, }, SectionSizeMismatch { expected: u32, consumed: u32, },
}
Expand description

Specific categories of decode errors.

Variants§

§

UnexpectedEof

Unexpected end of input.

§

InvalidMagic

Invalid magic number (expected \0asm).

§

UnsupportedVersion

Unsupported WASM version.

Fields

§found: u32
§

Leb128TooLong

LEB128 encoding exceeds the maximum number of bytes for the target type.

§

Leb128Overflow

LEB128 encoding has unused bits set in the final byte (overlong/overflow).

§

UnknownSectionId

Unknown section ID.

Fields

§id: u8
§

SectionOverflow

Section extends beyond the end of the binary.

§

SectionOutOfOrder

Sections are out of order (non-custom sections must be ordered by ID).

Fields

§prev: u8
§current: u8
§

DuplicateSection

Duplicate non-custom section.

Fields

§id: u8
§

UnknownValType

Unknown value type encoding byte.

Fields

§byte: u8
§

UnknownRefType

Unknown reference type encoding byte.

Fields

§byte: u8
§

UnknownImportDesc

Unknown import descriptor tag.

Fields

§byte: u8
§

UnknownExportDesc

Unknown export descriptor tag.

Fields

§byte: u8
§

InvalidMutability

Invalid global mutability encoding.

Fields

§byte: u8
§

InvalidUtf8

Invalid UTF-8 in a name string.

§

FunctionCodeLengthMismatch

Function and code section counts disagree.

Fields

§functions: u32
§codes: u32
§

TooManyLocals

Total local count exceeds the spec maximum (2^32 - 1).

§

UnknownOpcode

Unknown instruction opcode.

Fields

§byte: u8
§

UnknownSimdOpcode

Unknown SIMD-prefixed instruction opcode.

Fields

§opcode: u32
§

UnexpectedByte

Unexpected byte value.

Fields

§expected: u8
§found: u8
§

SectionSizeMismatch

Section body was not fully consumed.

Fields

§expected: u32
§consumed: u32

Trait Implementations§

Source§

impl Clone for DecodeErrorKind

Source§

fn clone(&self) -> DecodeErrorKind

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 Debug for DecodeErrorKind

Source§

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

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

impl Display for DecodeErrorKind

Source§

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

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

impl Eq for DecodeErrorKind

Source§

impl PartialEq for DecodeErrorKind

Source§

fn eq(&self, other: &DecodeErrorKind) -> 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 DecodeErrorKind

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.