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

A trait to unwrap a Result or Halt.

Required Methods§

source

fn or_halt<E: Environment>(self) -> T

Returns the result if it is successful, otherwise halt.

source

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

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

Implementations on Foreign Types§

source§

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

source§

fn or_halt<E: Environment>(self) -> T

Returns the result if it is successful, otherwise halt.

source§

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

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

Implementors§