among

Trait AmongOkExt

source
pub trait AmongOkExt<E, L, M, R> {
    // Required methods
    fn map_left<F, N>(self, l: F) -> Result<Among<N, M, R>, E>
       where F: FnOnce(L) -> N;
    fn map_middle<F, N>(self, m: F) -> Result<Among<L, N, R>, E>
       where F: FnOnce(M) -> N;
    fn map_right<F, N>(self, r: F) -> Result<Among<L, M, N>, E>
       where F: FnOnce(R) -> N;
}
Expand description

An extension trait for Result<Among<A, B, C>, _> that provides additional methods.

Required Methods§

source

fn map_left<F, N>(self, l: F) -> Result<Among<N, M, R>, E>
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.

source

fn map_middle<F, N>(self, m: F) -> Result<Among<L, N, R>, E>
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.

source

fn map_right<F, N>(self, r: F) -> Result<Among<L, M, N>, E>
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.

Implementations on Foreign Types§

source§

impl<E, L, M, R> AmongOkExt<E, L, M, R> for Result<Among<L, M, R>, E>

source§

fn map_left<F, N>(self, f: F) -> Result<Among<N, M, R>, E>
where F: FnOnce(L) -> N,

source§

fn map_middle<F, N>(self, f: F) -> Result<Among<L, N, R>, E>
where F: FnOnce(M) -> N,

source§

fn map_right<F, N>(self, f: F) -> Result<Among<L, M, N>, E>
where F: FnOnce(R) -> N,

Implementors§