Skip to main content

MapProblemOr

Trait MapProblemOr 

Source
pub trait MapProblemOr {
    type ProblemCarrier;

    // Required methods
    fn map_problem_or(self, problem: impl Into<Problem>) -> Self::ProblemCarrier;
    fn map_problem_or_else<F, P>(self, problem: F) -> Self::ProblemCarrier
       where F: FnOnce() -> P,
             P: Into<Problem>;
}
Expand description

Map type not containing any error to type containing given Problem

Required Associated Types§

Required Methods§

Source

fn map_problem_or(self, problem: impl Into<Problem>) -> Self::ProblemCarrier

Source

fn map_problem_or_else<F, P>(self, problem: F) -> Self::ProblemCarrier
where F: FnOnce() -> P, P: Into<Problem>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<O, E> MapProblemOr for Result<O, Option<E>>
where E: Into<Problem>,

Mapping Result with Option<E> to Result with Problem where E implements Into<Problem>

Source§

type ProblemCarrier = Result<O, Problem>

Source§

fn map_problem_or(self, problem: impl Into<Problem>) -> Result<O, Problem>

Source§

fn map_problem_or_else<F, P>(self, problem: F) -> Self::ProblemCarrier
where F: FnOnce() -> P, P: Into<Problem>,

Implementors§