IntoResult

Trait IntoResult 

Source
pub trait IntoResult<T> {
    // Required method
    fn catch(self, error_msg: impl ToString) -> Result<T, Box<dyn Error>>;
}
Expand description

A converter to convert Option<T> into Result<T, E> using catch fn.

Required Methods§

Source

fn catch(self, error_msg: impl ToString) -> Result<T, Box<dyn Error>>

Convert Option<T> into Result<T, E>

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> IntoResult<T> for Option<T>

Source§

fn catch(self, error_msg: impl ToString) -> Result<T, Box<dyn Error>>

Implementors§