Struct wasmtime::Trap[][src]

pub struct Trap { /* fields omitted */ }

A struct representing an aborted instruction execution, with a message indicating the cause.

Implementations

impl Trap[src]

pub fn new<I: Into<String>>(message: I) -> Self[src]

Creates a new Trap with message.

Example

let trap = wasmtime::Trap::new("unexpected error");
assert!(trap.to_string().contains("unexpected error"));

pub fn i32_exit(status: i32) -> Self[src]

Creates a new Trap representing an explicit program exit with a classic i32 exit status value.

pub fn i32_exit_status(&self) -> Option<i32>[src]

If the trap was the result of an explicit program exit with a classic i32 exit status value, return the value, otherwise return None.

pub fn trace(&self) -> &[FrameInfo][src]

Returns a list of function frames in WebAssembly code that led to this trap happening.

pub fn trap_code(&self) -> Option<TrapCode>[src]

Code of a trap that happened while executing a WASM instruction. If the trap was triggered by a host export this will be None.

Trait Implementations

impl Clone for Trap[src]

impl Debug for Trap[src]

impl Display for Trap[src]

impl Error for Trap[src]

impl From<Box<dyn Error + 'static + Sync + Send, Global>> for Trap[src]

impl From<Error> for Trap[src]

Auto Trait Implementations

impl !RefUnwindSafe for Trap

impl Send for Trap

impl Sync for Trap

impl Unpin for Trap

impl !UnwindSafe for Trap

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

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> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,