pub trait UnwrapOrTrap<T> {
// Required method
fn unwrap_or_trap(self) -> T;
}Expand description
Unwraps a Result<T, String> or traps with the error message.
Required Methods§
Sourcefn unwrap_or_trap(self) -> T
fn unwrap_or_trap(self) -> T
Returns the contained Ok(T) value, or traps with the contained error message.
§Panics
Traps the canister execution with the error string.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".