Trait ManagedResult

Source
pub trait ManagedResult<T, E> {
    // Required methods
    fn reject<M>(self, managed: &Managed<M>) -> Result<T, Rejected<E::Error>>
       where Self: Sized,
             M: Counted,
             E: OutcomeError;
    fn with_outcome(self, outcome: Outcome) -> Result<T, (Outcome, E)>
       where Self: Sized;
}
Expand description

Extension trait for Results, which adds convenience functions to work with errors and Managed.

Required Methods§

Source

fn reject<M>(self, managed: &Managed<M>) -> Result<T, Rejected<E::Error>>
where Self: Sized, M: Counted, E: OutcomeError,

Reject the entire Managed instance with E.

Source

fn with_outcome(self, outcome: Outcome) -> Result<T, (Outcome, E)>
where Self: Sized,

Wraps the error of the Result with an outcome.

Implementations on Foreign Types§

Source§

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

Source§

fn reject<M>(self, managed: &Managed<M>) -> Result<T, Rejected<E::Error>>
where Self: Sized, M: Counted, E: OutcomeError,

Source§

fn with_outcome(self, outcome: Outcome) -> Result<T, (Outcome, E)>
where Self: Sized,

Implementors§