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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.