[][src]Struct wasmer_engine::RuntimeError

pub struct RuntimeError { /* fields omitted */ }

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

Implementations

impl RuntimeError[src]

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

Creates a new generic RuntimeError with the given message.

Example

let trap = wasmer_engine::RuntimeError::new("unexpected error");
assert_eq!("unexpected error", trap.message());

pub fn from_trap(trap: Trap) -> Self[src]

Create a new RuntimeError from a Trap.

pub fn raise(error: Box<dyn Error + Send + Sync>) -> ![src]

Raises a custom user Error

pub fn message(&self) -> String[src]

Returns a reference the message stored in Trap.

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

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

pub fn downcast<T: Error + 'static>(self) -> Result<T, Self>[src]

Attempts to downcast the RuntimeError to a concrete type.

pub fn is<T: Error + 'static>(&self) -> bool[src]

Returns true if the RuntimeError is the same as T

Trait Implementations

impl Clone for RuntimeError[src]

impl Debug for RuntimeError[src]

impl Display for RuntimeError[src]

impl Error for RuntimeError[src]

impl From<Trap> for RuntimeError[src]

Auto Trait Implementations

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> 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.