Trait libimagerror::io::ToExitCode
source · pub trait ToExitCode<T> {
fn to_exit_code(self) -> Result<T, ExitCode>;
fn to_exit_code_with(self, _: Settings) -> Result<T, ExitCode>;
}
Required Methods
fn to_exit_code(self) -> Result<T, ExitCode>
fn to_exit_code_with(self, _: Settings) -> Result<T, ExitCode>
Implementations on Foreign Types
sourceimpl<T> ToExitCode<T> for Result<T, Error>
impl<T> ToExitCode<T> for Result<T, Error>
sourcefn to_exit_code(self) -> Result<T, ExitCode>
fn to_exit_code(self) -> Result<T, ExitCode>
Returns an exit code of 0 if the error was a broken pipe, else 1
sourcefn to_exit_code_with(self, settings: Settings) -> Result<T, ExitCode>
fn to_exit_code_with(self, settings: Settings) -> Result<T, ExitCode>
Returns an exit code depending on the settings
Via the settings, errors can be ignores (translates to exit code zero). All other errors are translated into exit code 1