ckb_types::prelude

Trait ShouldBeOk

Source
pub trait ShouldBeOk<T> {
    // Required method
    fn should_be_ok(self) -> T;
}
Expand description

An alias of unwrap() to mark where we are really have confidence to do unwrap.

We can also customize the panic message or do something else in this alias.

Required Methods§

Source

fn should_be_ok(self) -> T

Unwraps an Option or a Result with confidence and we assume that it’s impossible to fail.

Implementations on Foreign Types§

Source§

impl<T> ShouldBeOk<T> for Option<T>

Source§

fn should_be_ok(self) -> T

Source§

impl<T> ShouldBeOk<T> for Result<T, VerificationError>

Source§

fn should_be_ok(self) -> T

Implementors§