pub trait OrHalt<T> {
    fn or_halt<E>(self) -> T
    where
        E: Environment
; fn or_halt_with<E>(self, msg: &str) -> T
    where
        E: Environment
; }
Expand description

A trait to unwrap a Result or Halt.

Required Methods§

fn or_halt<E>(self) -> Twhere
    E: Environment,

Returns the result if it is successful, otherwise halt.

fn or_halt_with<E>(self, msg: &str) -> Twhere
    E: Environment,

Returns the result if it is successful, otherwise halts with the message.

Implementations on Foreign Types§

§

impl<T, Error> OrHalt<T> for Result<T, Error>where
    Error: Display,

§

fn or_halt<E>(self) -> Twhere
    E: Environment,

Returns the result if it is successful, otherwise halt.

§

fn or_halt_with<E>(self, msg: &str) -> Twhere
    E: Environment,

Returns the result if it is successful, otherwise halts with the message.

Implementors§