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.
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.
SectionOverflow
Section extends beyond the end of the binary.
SectionOutOfOrder
Sections are out of order (non-custom sections must be ordered by ID).
DuplicateSection
Duplicate non-custom section.
UnknownValType
Unknown value type encoding byte.
UnknownRefType
Unknown reference type encoding byte.
UnknownImportDesc
Unknown import descriptor tag.
UnknownExportDesc
Unknown export descriptor tag.
InvalidMutability
Invalid global mutability encoding.
InvalidUtf8
Invalid UTF-8 in a name string.
FunctionCodeLengthMismatch
Function and code section counts disagree.
TooManyLocals
Total local count exceeds the spec maximum (2^32 - 1).
UnknownOpcode
Unknown instruction opcode.
UnknownSimdOpcode
Unknown SIMD-prefixed instruction opcode.
UnexpectedByte
Unexpected byte value.
SectionSizeMismatch
Section body was not fully consumed.
Trait Implementations§
Source§impl Clone for DecodeErrorKind
impl Clone for DecodeErrorKind
Source§fn clone(&self) -> DecodeErrorKind
fn clone(&self) -> DecodeErrorKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more