pub trait UnwrapOrTrapResult<T> {
// Required method
fn unwrap_or_trap_result(self) -> T;
}Expand description
Unwraps a Result<Option<T>, E> into T, trapping on either failure.
Required Methods§
Sourcefn unwrap_or_trap_result(self) -> T
fn unwrap_or_trap_result(self) -> T
Returns the contained Ok(Some(T)) value, or traps.
§Panics
Traps the canister execution with the error message if the Result is Err,
or with a default message if the Option is None.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".