Trait mz_adapter::util::ResultExt
source · pub trait ResultExt<T> {
// Required methods
fn unwrap_or_terminate(self, context: &str) -> T;
fn maybe_terminate(self, context: &str) -> Self;
}
Required Methods§
sourcefn unwrap_or_terminate(self, context: &str) -> T
fn unwrap_or_terminate(self, context: &str) -> T
Like Result::expect
, but terminates the process with halt
or
exit code 0 instead of panic
if the error indicates that it should
cause a halt of graceful termination.
sourcefn maybe_terminate(self, context: &str) -> Self
fn maybe_terminate(self, context: &str) -> Self
Terminates the process with halt
or exit code 0 if self
is an
error that should halt or cause graceful termination. Otherwise,
does nothing.
Object Safety§
This trait is not object safe.