pub enum TrapReason {
    User {
        error: Error,
        needs_backtrace: bool,
    },
    Jit(usize),
    Wasm(TrapCode),
}
Expand description

Enumeration of different methods of raising a trap.

Variants

User

Fields

error: Error

The actual user trap error.

needs_backtrace: bool

Whether we need to capture a backtrace for this error or not.

A user-raised trap through raise_user_trap.

Jit(usize)

A trap raised from Cranelift-generated code with the pc listed of where the trap came from.

Wasm(TrapCode)

A trap raised from a wasm libcall

Implementations

Create a new TrapReason::User that does not have a backtrace yet.

Create a new TrapReason::User that already has a backtrace.

Is this a JIT trap?

Trait Implementations

Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.