Trait UniformUnwrap

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

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

Required Methods§

Source

fn uni_is_err(&self) -> bool

Source

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

Source

fn sink(self)

Provided Methods§

Source

fn fail(self) -> T

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 uni_is_err(&self) -> bool

Source§

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

Source§

fn sink(self)

Source§

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

Source§

fn uni_is_err(&self) -> bool

Source§

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

Source§

fn sink(self)

Implementors§