Handle

Trait Handle 

Source
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§

Source

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.

Source

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.

Implementors§

Source§

impl<T> Handle<T> for Result<T>