Struct wasmtime::Trap [−][src]
pub struct Trap { /* fields omitted */ }
Expand description
A struct representing an aborted instruction execution, with a message indicating the cause.
Implementations
impl Trap
[src]
impl Trap
[src]pub fn new<I: Into<String>>(message: I) -> Self
[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]
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]
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
.
Trait Implementations
impl Error for Trap
[src]
impl Error for Trap
[src]fn source(&self) -> Option<&(dyn Error + 'static)>
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
[src]The lower-level source of this error, if any. Read more
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
fn description(&self) -> &str
1.0.0[src]
fn description(&self) -> &str
1.0.0[src]use the Display impl or to_string()
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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,