pub trait Handle<T> {
// Required methods
fn handle(self) -> Option<T>;
fn handle_or_panic(self) -> T;
}Expand description
Extension for Result<T> to allow for custom error handling.
Required Methods§
Sourcefn handle(self) -> Option<T>
fn handle(self) -> Option<T>
Handles the result. If it contains an error a backtrace is created and the error is printed to the console.
Sourcefn handle_or_panic(self) -> T
fn handle_or_panic(self) -> T
Handles the result or panics if it is Err. If it contains
an error a backtrace is created and the error is printed to the console.