pub trait EitherErrExt<T, A, B> {
// Required methods
fn map_err_left<F, U>(self, f: F) -> Result<T, Either<U, B>>
where F: FnOnce(A) -> U;
fn map_err_right<F, U>(self, f: F) -> Result<T, Either<A, U>>
where F: FnOnce(B) -> U;
}Available on crate feature
either only.Expand description
An extension trait for Result<T, Either<A, B>> that provides additional methods.
Required Methods§
sourcefn map_err_left<F, U>(self, f: F) -> Result<T, Either<U, B>>where
F: FnOnce(A) -> U,
fn map_err_left<F, U>(self, f: F) -> Result<T, Either<U, B>>where
F: FnOnce(A) -> U,
Apply the function f on the value in the Left variant if it is present rewrapping the
result in Left.
sourcefn map_err_right<F, U>(self, f: F) -> Result<T, Either<A, U>>where
F: FnOnce(B) -> U,
fn map_err_right<F, U>(self, f: F) -> Result<T, Either<A, U>>where
F: FnOnce(B) -> U,
Apply the function f on the value in the Right variant if it is present rewrapping the
result in Right.
Object Safety§
This trait is not object safe.