pub struct ThrownException;gc only.Expand description
An error type that represents that a pending WebAssembly exception
is set on the associated Store.
When used as an error type and returned from a Wasm-to-host call,
or host-to-Wasm call, it indicates that the caller should either
continue propagating the error upward, or take and handle the
exception using [crate::Store::take_exception] (or a helper such
as [crate::Store::catch].
Wasmtime uses an error type without payload, and stores the exception itself on the store, to maintain proper GC rooting; otherwise, it is difficult to get exception propagation up the stack right in the presence of nested handle scopes. A pending exception on the store is safely rooted as long as it is stored there.
Trait Implementations§
Source§impl Debug for ThrownException
Available on crate feature runtime only.
impl Debug for ThrownException
runtime only.Source§impl Display for ThrownException
Available on crate feature runtime only.Error requires Display.
impl Display for ThrownException
runtime only.Error requires Display.
Source§impl Error for ThrownException
Available on crate feature runtime only.We need to implement Error for ThrownException so it can be boxed up into an anyhow::Error.
impl Error for ThrownException
runtime only.We need to implement Error for ThrownException so it can be boxed up into an anyhow::Error.
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for ThrownException
impl RefUnwindSafe for ThrownException
impl Send for ThrownException
impl Sync for ThrownException
impl Unpin for ThrownException
impl UnwindSafe for ThrownException
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more