Skip to main content

UnwrapOrTrapResult

Trait UnwrapOrTrapResult 

Source
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§

Source

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".

Implementations on Foreign Types§

Source§

impl<T, E: Display> UnwrapOrTrapResult<T> for Result<Option<T>, E>

Implementors§