Skip to main content

UniformUnwrap

Trait UniformUnwrap 

Source
pub trait UniformUnwrap<T>: Sized {
    // Required methods
    fn res(self) -> Res<T>;
    fn uni_is_err(&self) -> bool;
    fn uni_or_else(self, op: impl FnOnce(&str) -> T) -> T;

    // Provided methods
    fn fail(self) -> T { ... }
    fn sink(self) { ... }
}

Required Methods§

Source

fn res(self) -> Res<T>

Source

fn uni_is_err(&self) -> bool

Source

fn uni_or_else(self, op: impl FnOnce(&str) -> T) -> T

Provided Methods§

Source

fn fail(self) -> T

Source

fn sink(self)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> UniformUnwrap<T> for Option<T>

Source§

fn res(self) -> Res<T>

Source§

fn uni_is_err(&self) -> bool

Source§

fn uni_or_else(self, op: impl FnOnce(&str) -> T) -> T

Source§

impl<T, R: Display> UniformUnwrap<T> for Result<T, R>

Source§

fn res(self) -> Res<T>

Source§

fn uni_is_err(&self) -> bool

Source§

fn uni_or_else(self, op: impl FnOnce(&str) -> T) -> T

Implementors§