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§

source

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.

source

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.

Implementations on Foreign Types§

source§

impl<T, E> ResultExt<T> for Result<T, E>

source§

fn unwrap_or_terminate(self, context: &str) -> T

source§

fn maybe_terminate(self, context: &str) -> Self

Implementors§