Trait snarkvm_console_types_group::OrHalt
source · pub trait OrHalt<T> {
// Required methods
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§
sourcefn or_halt<E>(self) -> Twhere
E: Environment,
fn or_halt<E>(self) -> Twhere E: Environment,
Returns the result if it is successful, otherwise halt.
sourcefn or_halt_with<E>(self, msg: &str) -> Twhere
E: Environment,
fn or_halt_with<E>(self, msg: &str) -> Twhere E: Environment,
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> OrHalt<T> for Result<T, Error>where
Error: Display,
impl<T, Error> OrHalt<T> for Result<T, Error>where Error: Display,
source§fn or_halt<E>(self) -> Twhere
E: Environment,
fn or_halt<E>(self) -> Twhere E: Environment,
Returns the result if it is successful, otherwise halt.
source§fn or_halt_with<E>(self, msg: &str) -> Twhere
E: Environment,
fn or_halt_with<E>(self, msg: &str) -> Twhere E: Environment,
Returns the result if it is successful, otherwise halts with the message.