[][src]Enum cranelift_wasm::WasmError

pub enum WasmError {
    InvalidWebAssembly {
        message: &'static str,
        offset: usize,
    },
    Unsupported(&'static str),
    ImplLimitExceeded,
    User(String),
}

A WebAssembly translation error.

When a WebAssembly function can't be translated, one of these error codes will be returned to describe the failure.

Variants

InvalidWebAssembly

The input WebAssembly code is invalid.

This error code is used by a WebAssembly translator when it encounters invalid WebAssembly code. This should never happen for validated WebAssembly code.

Fields of InvalidWebAssembly

message: &'static str

A string describing the validation error.

offset: usize

The bytecode offset where the error occurred.

Unsupported(&'static str)

A feature used by the WebAssembly code is not supported by the embedding environment.

Embedding environments may have their own limitations and feature restrictions.

ImplLimitExceeded

An implementation limit was exceeded.

Cranelift can compile very large and complicated functions, but the implementation has limits that cause compilation to fail when they are exceeded.

User(String)

Any user-defined error.

Trait Implementations

impl Display for WasmError[src]

impl Debug for WasmError[src]

impl From<BinaryReaderError> for WasmError[src]

fn from(e: BinaryReaderError) -> Self[src]

Convert from a BinaryReaderError to a WasmError.

impl Fail for WasmError[src]

fn context<D>(self, context: D) -> Context<D> where
    D: Display + Send + Sync + 'static, 
[src]

Provides context for this failure. Read more

fn compat(self) -> Compat<Self>[src]

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

Auto Trait Implementations

Blanket Implementations

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> Into<U> for T where
    U: From<T>, 
[src]

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

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.

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

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

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

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

impl<T> AsFail for T where
    T: Fail
[src]