pub trait OkOrProblem<O> {
// Required methods
fn ok_or_problem<P>(self, problem: P) -> Result<O, Problem>
where P: Into<Problem>;
fn ok_or_problem_with<F, P>(self, problem: F) -> Result<O, Problem>
where F: FnOnce() -> P,
P: Into<Problem>;
}Expand description
Extension trait to map Option to Result with Problem
Required Methods§
fn ok_or_problem<P>(self, problem: P) -> Result<O, Problem>
fn ok_or_problem_with<F, P>(self, problem: F) -> Result<O, Problem>
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.