pub trait ResultExt<T> {
// Required methods
fn display_err(self, ctx: &OutputContext) -> Result<T, ()>;
fn display_and_exit(self, ctx: &OutputContext, exit_code: i32) -> T;
}Expand description
Extension trait for Result types to display errors.
Required Methods§
Sourcefn display_err(self, ctx: &OutputContext) -> Result<T, ()>
fn display_err(self, ctx: &OutputContext) -> Result<T, ()>
Display the error if present using the given output context.
Sourcefn display_and_exit(self, ctx: &OutputContext, exit_code: i32) -> T
fn display_and_exit(self, ctx: &OutputContext, exit_code: i32) -> T
Display the error if present and exit with the given code.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".