pub trait UnwrapAbort {
    type Unwrap;

    // Required method
    fn unwrap_abort(self) -> Self::Unwrap;
}
Expand description

Add optimized unwrap behaviour that aborts the process instead of panicking.

Required Associated Types§

source

type Unwrap

The underlying result type of the unwrap, in case of success.

Required Methods§

source

fn unwrap_abort(self) -> Self::Unwrap

Unwrap or call trap. In contrast to the unwrap methods on Option::unwrap this method will tend to produce smaller code, at the cost of the ability to handle the panic. This is intended to be used only in Wasm code, where panics cannot be handled anyhow.

Implementations on Foreign Types§

source§

impl<A> UnwrapAbort for Option<A>

§

type Unwrap = A

source§

fn unwrap_abort(self) -> Self::Unwrap

source§

impl<A, E> UnwrapAbort for Result<A, E>

§

type Unwrap = A

source§

fn unwrap_abort(self) -> Self::Unwrap

Implementors§