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§
sourcefn or_halt<E: Environment>(self) -> T
fn or_halt<E: Environment>(self) -> T
Returns the result if it is successful, otherwise halt.
sourcefn or_halt_with<E: Environment>(self, msg: &str) -> T
fn or_halt_with<E: Environment>(self, msg: &str) -> T
Returns the result if it is successful, otherwise halts with the message.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<T, Error: Display> OrHalt<T> for Result<T, Error>
impl<T, Error: Display> OrHalt<T> for Result<T, Error>
source§fn or_halt<E: Environment>(self) -> T
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
fn or_halt_with<E: Environment>(self, msg: &str) -> T
Returns the result if it is successful, otherwise halts with the message.