Trait ProblemWhile

Source
pub trait ProblemWhile {
    type WithContext;

    // Required methods
    fn problem_while(self, message: impl ToString) -> Self::WithContext;
    fn problem_while_with<F, M>(self, message: F) -> Self::WithContext
       where F: FnOnce() -> M,
             M: ToString;
}
Expand description

Convert to Problem if needed and add context to it

Required Associated Types§

Required Methods§

Source

fn problem_while(self, message: impl ToString) -> Self::WithContext

Add context information

Source

fn problem_while_with<F, M>(self, message: F) -> Self::WithContext
where F: FnOnce() -> M, M: ToString,

Add context information from function call

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<O, E> ProblemWhile for Result<O, E>
where E: Into<Problem>,

Source§

type WithContext = Result<O, Problem>

Source§

fn problem_while(self, message: impl ToString) -> Result<O, Problem>

Source§

fn problem_while_with<F, M>(self, message: F) -> Result<O, Problem>
where F: FnOnce() -> M, M: ToString,

Implementors§