ClearResult

Trait ClearResult 

Source
pub trait ClearResult<T, E> {
    // Required methods
    fn clear_err(self) -> Result<T, ()>;
    fn clear_ok(self) -> Result<(), E>;
}
Expand description

Trait for clearing either the success or error part of a Result.

Required Methods§

Source

fn clear_err(self) -> Result<T, ()>

Clear the error type, converting any error to ().

Source

fn clear_ok(self) -> Result<(), E>

Clear the success type, converting any success value to ().

Implementations on Foreign Types§

Source§

impl<T, E> ClearResult<T, E> for Result<T, E>

Source§

fn clear_err(self) -> Result<T, ()>

Source§

fn clear_ok(self) -> Result<(), E>

Implementors§