pub trait OrHalt<T> {
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.
Implementations on Foreign Types
sourceimpl<T, Error: Display> OrHalt<T> for Result<T, Error>
impl<T, Error: Display> OrHalt<T> for Result<T, Error>
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.