pub trait AmongErrorExt<T, L, M, R> {
// Required methods
fn map_err_left<F, N>(self, l: F) -> Result<T, Among<N, M, R>>
where F: FnOnce(L) -> N;
fn map_err_middle<F, N>(self, m: F) -> Result<T, Among<L, N, R>>
where F: FnOnce(M) -> N;
fn map_err_right<F, N>(self, r: F) -> Result<T, Among<L, M, N>>
where F: FnOnce(R) -> N;
}Expand description
An extension trait for Result<_, Among<A, B, C>> that provides additional methods.
Required Methods§
sourcefn map_err_left<F, N>(self, l: F) -> Result<T, Among<N, M, R>>where
F: FnOnce(L) -> N,
fn map_err_left<F, N>(self, l: F) -> Result<T, Among<N, M, R>>where
F: FnOnce(L) -> N,
Apply the function f on the value in the Left variant if it is present rewrapping the
result in Left.
sourcefn map_err_middle<F, N>(self, m: F) -> Result<T, Among<L, N, R>>where
F: FnOnce(M) -> N,
fn map_err_middle<F, N>(self, m: F) -> Result<T, Among<L, N, R>>where
F: FnOnce(M) -> N,
Apply the function f on the value in the Middle variant if it is present rewrapping the
result in Middle.
sourcefn map_err_right<F, N>(self, r: F) -> Result<T, Among<L, M, N>>where
F: FnOnce(R) -> N,
fn map_err_right<F, N>(self, r: F) -> Result<T, Among<L, M, N>>where
F: FnOnce(R) -> N,
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.