CliErrorHandler

Trait CliErrorHandler 

Source
pub trait CliErrorHandler {
    type Output;

    // Required methods
    fn unwrap_or_exit(self) -> Self::Output;
    fn then_exit(self) -> !;
}

Required Associated Types§

Required Methods§

Source

fn unwrap_or_exit(self) -> Self::Output

Source

fn then_exit(self) -> !

Implementations on Foreign Types§

Source§

impl<T, E> CliErrorHandler for Result<T, E>
where E: Into<CliError>,

Source§

fn unwrap_or_exit(self) -> T

Returns the result if it is Ok, otherwise exit the program with the appropriate exit code after printing the error.

Source§

fn then_exit(self) -> !

Exit the program with appropriate exit code. This will also print the error if the result is an error.

Source§

type Output = T

Implementors§