Trait ErrGettable

Source
pub trait ErrGettable {
    type Res;

    // Required method
    fn get_err(self) -> Self::Res;
}

Required Associated Types§

Required Methods§

Source

fn get_err(self) -> Self::Res

Implementations on Foreign Types§

Source§

impl<T, E: Empty> ErrGettable for Result<T, E>

Source§

fn get_err(self) -> E

Safely unwraps a Result, yielding the content of an Err.

§Examples
let x: Rresult<u32, &str> = Ok(2);
x.get_err(); 
let x: Rresult<u32, &str> = Err("emergency failure");
assert_eq!(x.get_err(), "emergency failure");
Source§

type Res = E

Implementors§