Skip to main content

UnwrapOrErr

Trait UnwrapOrErr 

Source
pub trait UnwrapOrErr<T> {
    // Required method
    fn unwrap_or_err(self) -> T;
}
Expand description

Returns the Ok value or the Err value. Available when the Ok and Err types are the same. This is a way to default the result using the specific Err value rather than unwrap_or_default() using Ok’s default.

Required Methods§

Source

fn unwrap_or_err(self) -> T

Implementors§

Source§

impl<T> UnwrapOrErr<T> for Result<T, T>