[][src]Struct wasmer_engine::RuntimeError

pub struct RuntimeError { /* fields omitted */ }

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


impl RuntimeError[src]

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

Creates a new generic RuntimeError with the given message.


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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.