pub trait UnwrapThrowExt<T>: Sized {
// Required methods
fn unwrap_throw(self) -> T;
fn expect_throw(self, message: &str) -> T;
}Expand description
Extension trait for Option to unwrap or throw a JS error. This is API-compatible with wasm-bindgen’s UnwrapThrowExt.
Required Methods§
Sourcefn unwrap_throw(self) -> T
fn unwrap_throw(self) -> T
Unwrap the value or panic with a message.
Sourcefn expect_throw(self, message: &str) -> T
fn expect_throw(self, message: &str) -> T
Unwrap the value or panic with a custom message.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.