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§
Sourcefn reject<M>(self, managed: &Managed<M>) -> Result<T, Rejected<E::Error>>
fn reject<M>(self, managed: &Managed<M>) -> Result<T, Rejected<E::Error>>
Reject the entire Managed
instance with E
.
Sourcefn with_outcome(self, outcome: Outcome) -> Result<T, (Outcome, E)>where
Self: Sized,
fn with_outcome(self, outcome: Outcome) -> Result<T, (Outcome, E)>where
Self: Sized,
Wraps the error of the Result
with an outcome.