[−]Struct wasmer_runtime::error::RuntimeError
A struct representing an aborted instruction execution, with a message indicating the cause.
Implementations
impl RuntimeError
pub fn new<I>(message: I) -> RuntimeError where
I: Into<String>,
I: Into<String>,
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) -> RuntimeError
Create a new RuntimeError from a Trap.
pub fn raise(error: Box<dyn Error + 'static + Sync + Send>) -> !
Raises a custom user Error
pub fn message(&self) -> String
Returns a reference the message stored in Trap.
pub fn trace(&self) -> &[FrameInfo]ⓘ
Returns a list of function frames in WebAssembly code that led to this trap happening.
pub fn downcast<T>(self) -> Result<T, RuntimeError> where
T: 'static + Error,
T: 'static + Error,
Attempts to downcast the RuntimeError to a concrete type.
pub fn is<T>(&self) -> bool where
T: 'static + Error,
T: 'static + Error,
Returns true if the RuntimeError is the same as T
Trait Implementations
impl Clone for RuntimeError
fn clone(&self) -> RuntimeError
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for RuntimeError
impl Display for RuntimeError
impl Error for RuntimeError
fn source(&self) -> Option<&(dyn Error + 'static)>
fn backtrace(&self) -> Option<&Backtrace>[src]
fn description(&self) -> &str1.0.0[src]
fn cause(&self) -> Option<&dyn Error>1.0.0[src]
impl From<Trap> for RuntimeError
fn from(trap: Trap) -> RuntimeError
Auto Trait Implementations
impl !RefUnwindSafe for RuntimeError
impl Send for RuntimeError
impl Sync for RuntimeError
impl Unpin for RuntimeError
impl !UnwindSafe for RuntimeError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,