pub trait TryJoin {
    type Output;
    type Error;
    type Future: Future<Output = Result<Self::Output, Self::Error>>;

    // Required method
    fn try_join(self) -> Self::Future;
}
Expand description

Wait for all futures to complete successfully, or abort early on error.

In the case a future errors, all other futures will be cancelled. If futures have been completed, their results will be discarded.

If you want to keep partial data in the case of failure, see the merge operation.

Required Associated Types§

source

type Output

The resulting output type.

source

type Error

The resulting error type.

source

type Future: Future<Output = Result<Self::Output, Self::Error>>

Which kind of future are we turning this into?

Required Methods§

source

fn try_join(self) -> Self::Future

Waits for multiple futures to complete, either returning when all futures complete successfully, or return early when any future completes with an error.

Implementations on Foreign Types§

source§

impl<ERR, A, ResA, B, ResB, C, ResC, D, ResD, E, ResE> TryJoin for (A, B, C, D, E)where A: IntoFuture<Output = Result<ResA, ERR>>, B: IntoFuture<Output = Result<ResB, ERR>>, C: IntoFuture<Output = Result<ResC, ERR>>, D: IntoFuture<Output = Result<ResD, ERR>>, E: IntoFuture<Output = Result<ResE, ERR>>,

§

type Output = (ResA, ResB, ResC, ResD, ResE)

§

type Error = ERR

§

type Future = TryJoin5<<A as IntoFuture>::IntoFuture, ResA, <B as IntoFuture>::IntoFuture, ResB, <C as IntoFuture>::IntoFuture, ResC, <D as IntoFuture>::IntoFuture, ResD, <E as IntoFuture>::IntoFuture, ResE>

source§

fn try_join(self) -> Self::Future

source§

impl<ERR, A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, F, ResF, G, ResG, H, ResH> TryJoin for (A, B, C, D, E, F, G, H)where A: IntoFuture<Output = Result<ResA, ERR>>, B: IntoFuture<Output = Result<ResB, ERR>>, C: IntoFuture<Output = Result<ResC, ERR>>, D: IntoFuture<Output = Result<ResD, ERR>>, E: IntoFuture<Output = Result<ResE, ERR>>, F: IntoFuture<Output = Result<ResF, ERR>>, G: IntoFuture<Output = Result<ResG, ERR>>, H: IntoFuture<Output = Result<ResH, ERR>>,

§

type Output = (ResA, ResB, ResC, ResD, ResE, ResF, ResG, ResH)

§

type Error = ERR

§

type Future = TryJoin8<<A as IntoFuture>::IntoFuture, ResA, <B as IntoFuture>::IntoFuture, ResB, <C as IntoFuture>::IntoFuture, ResC, <D as IntoFuture>::IntoFuture, ResD, <E as IntoFuture>::IntoFuture, ResE, <F as IntoFuture>::IntoFuture, ResF, <G as IntoFuture>::IntoFuture, ResG, <H as IntoFuture>::IntoFuture, ResH>

source§

fn try_join(self) -> Self::Future

source§

impl<ERR, A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, F, ResF, G, ResG, H, ResH, I, ResI, J, ResJ, K, ResK, L, ResL> TryJoin for (A, B, C, D, E, F, G, H, I, J, K, L)where A: IntoFuture<Output = Result<ResA, ERR>>, B: IntoFuture<Output = Result<ResB, ERR>>, C: IntoFuture<Output = Result<ResC, ERR>>, D: IntoFuture<Output = Result<ResD, ERR>>, E: IntoFuture<Output = Result<ResE, ERR>>, F: IntoFuture<Output = Result<ResF, ERR>>, G: IntoFuture<Output = Result<ResG, ERR>>, H: IntoFuture<Output = Result<ResH, ERR>>, I: IntoFuture<Output = Result<ResI, ERR>>, J: IntoFuture<Output = Result<ResJ, ERR>>, K: IntoFuture<Output = Result<ResK, ERR>>, L: IntoFuture<Output = Result<ResL, ERR>>,

§

type Output = (ResA, ResB, ResC, ResD, ResE, ResF, ResG, ResH, ResI, ResJ, ResK, ResL)

§

type Error = ERR

§

type Future = TryJoin12<<A as IntoFuture>::IntoFuture, ResA, <B as IntoFuture>::IntoFuture, ResB, <C as IntoFuture>::IntoFuture, ResC, <D as IntoFuture>::IntoFuture, ResD, <E as IntoFuture>::IntoFuture, ResE, <F as IntoFuture>::IntoFuture, ResF, <G as IntoFuture>::IntoFuture, ResG, <H as IntoFuture>::IntoFuture, ResH, <I as IntoFuture>::IntoFuture, ResI, <J as IntoFuture>::IntoFuture, ResJ, <K as IntoFuture>::IntoFuture, ResK, <L as IntoFuture>::IntoFuture, ResL>

source§

fn try_join(self) -> Self::Future

source§

impl<Fut, T, E> TryJoin for Vec<Fut>where Fut: IntoFuture<Output = Result<T, E>>,

§

type Output = Vec<T, Global>

§

type Error = E

§

type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E>

source§

fn try_join(self) -> Self::Future

source§

impl<ERR, A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, F, ResF, G, ResG, H, ResH, I, ResI, J, ResJ> TryJoin for (A, B, C, D, E, F, G, H, I, J)where A: IntoFuture<Output = Result<ResA, ERR>>, B: IntoFuture<Output = Result<ResB, ERR>>, C: IntoFuture<Output = Result<ResC, ERR>>, D: IntoFuture<Output = Result<ResD, ERR>>, E: IntoFuture<Output = Result<ResE, ERR>>, F: IntoFuture<Output = Result<ResF, ERR>>, G: IntoFuture<Output = Result<ResG, ERR>>, H: IntoFuture<Output = Result<ResH, ERR>>, I: IntoFuture<Output = Result<ResI, ERR>>, J: IntoFuture<Output = Result<ResJ, ERR>>,

§

type Output = (ResA, ResB, ResC, ResD, ResE, ResF, ResG, ResH, ResI, ResJ)

§

type Error = ERR

§

type Future = TryJoin10<<A as IntoFuture>::IntoFuture, ResA, <B as IntoFuture>::IntoFuture, ResB, <C as IntoFuture>::IntoFuture, ResC, <D as IntoFuture>::IntoFuture, ResD, <E as IntoFuture>::IntoFuture, ResE, <F as IntoFuture>::IntoFuture, ResF, <G as IntoFuture>::IntoFuture, ResG, <H as IntoFuture>::IntoFuture, ResH, <I as IntoFuture>::IntoFuture, ResI, <J as IntoFuture>::IntoFuture, ResJ>

source§

fn try_join(self) -> Self::Future

source§

impl<ERR, A, ResA, B, ResB> TryJoin for (A, B)where A: IntoFuture<Output = Result<ResA, ERR>>, B: IntoFuture<Output = Result<ResB, ERR>>,

§

type Output = (ResA, ResB)

§

type Error = ERR

§

type Future = TryJoin2<<A as IntoFuture>::IntoFuture, ResA, <B as IntoFuture>::IntoFuture, ResB>

source§

fn try_join(self) -> Self::Future

source§

impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where Fut: IntoFuture<Output = Result<T, E>>,

§

type Output = [T; N]

§

type Error = E

§

type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>

source§

fn try_join(self) -> Self::Future

source§

impl<ERR, A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, F, ResF, G, ResG> TryJoin for (A, B, C, D, E, F, G)where A: IntoFuture<Output = Result<ResA, ERR>>, B: IntoFuture<Output = Result<ResB, ERR>>, C: IntoFuture<Output = Result<ResC, ERR>>, D: IntoFuture<Output = Result<ResD, ERR>>, E: IntoFuture<Output = Result<ResE, ERR>>, F: IntoFuture<Output = Result<ResF, ERR>>, G: IntoFuture<Output = Result<ResG, ERR>>,

§

type Output = (ResA, ResB, ResC, ResD, ResE, ResF, ResG)

§

type Error = ERR

§

type Future = TryJoin7<<A as IntoFuture>::IntoFuture, ResA, <B as IntoFuture>::IntoFuture, ResB, <C as IntoFuture>::IntoFuture, ResC, <D as IntoFuture>::IntoFuture, ResD, <E as IntoFuture>::IntoFuture, ResE, <F as IntoFuture>::IntoFuture, ResF, <G as IntoFuture>::IntoFuture, ResG>

source§

fn try_join(self) -> Self::Future

source§

impl<ERR, A, ResA> TryJoin for (A,)where A: IntoFuture<Output = Result<ResA, ERR>>,

§

type Output = (ResA,)

§

type Error = ERR

§

type Future = TryJoin1<<A as IntoFuture>::IntoFuture, ResA>

source§

fn try_join(self) -> Self::Future

source§

impl<ERR, A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, F, ResF, G, ResG, H, ResH, I, ResI> TryJoin for (A, B, C, D, E, F, G, H, I)where A: IntoFuture<Output = Result<ResA, ERR>>, B: IntoFuture<Output = Result<ResB, ERR>>, C: IntoFuture<Output = Result<ResC, ERR>>, D: IntoFuture<Output = Result<ResD, ERR>>, E: IntoFuture<Output = Result<ResE, ERR>>, F: IntoFuture<Output = Result<ResF, ERR>>, G: IntoFuture<Output = Result<ResG, ERR>>, H: IntoFuture<Output = Result<ResH, ERR>>, I: IntoFuture<Output = Result<ResI, ERR>>,

§

type Output = (ResA, ResB, ResC, ResD, ResE, ResF, ResG, ResH, ResI)

§

type Error = ERR

§

type Future = TryJoin9<<A as IntoFuture>::IntoFuture, ResA, <B as IntoFuture>::IntoFuture, ResB, <C as IntoFuture>::IntoFuture, ResC, <D as IntoFuture>::IntoFuture, ResD, <E as IntoFuture>::IntoFuture, ResE, <F as IntoFuture>::IntoFuture, ResF, <G as IntoFuture>::IntoFuture, ResG, <H as IntoFuture>::IntoFuture, ResH, <I as IntoFuture>::IntoFuture, ResI>

source§

fn try_join(self) -> Self::Future

source§

impl<ERR, A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, F, ResF, G, ResG, H, ResH, I, ResI, J, ResJ, K, ResK> TryJoin for (A, B, C, D, E, F, G, H, I, J, K)where A: IntoFuture<Output = Result<ResA, ERR>>, B: IntoFuture<Output = Result<ResB, ERR>>, C: IntoFuture<Output = Result<ResC, ERR>>, D: IntoFuture<Output = Result<ResD, ERR>>, E: IntoFuture<Output = Result<ResE, ERR>>, F: IntoFuture<Output = Result<ResF, ERR>>, G: IntoFuture<Output = Result<ResG, ERR>>, H: IntoFuture<Output = Result<ResH, ERR>>, I: IntoFuture<Output = Result<ResI, ERR>>, J: IntoFuture<Output = Result<ResJ, ERR>>, K: IntoFuture<Output = Result<ResK, ERR>>,

§

type Output = (ResA, ResB, ResC, ResD, ResE, ResF, ResG, ResH, ResI, ResJ, ResK)

§

type Error = ERR

§

type Future = TryJoin11<<A as IntoFuture>::IntoFuture, ResA, <B as IntoFuture>::IntoFuture, ResB, <C as IntoFuture>::IntoFuture, ResC, <D as IntoFuture>::IntoFuture, ResD, <E as IntoFuture>::IntoFuture, ResE, <F as IntoFuture>::IntoFuture, ResF, <G as IntoFuture>::IntoFuture, ResG, <H as IntoFuture>::IntoFuture, ResH, <I as IntoFuture>::IntoFuture, ResI, <J as IntoFuture>::IntoFuture, ResJ, <K as IntoFuture>::IntoFuture, ResK>

source§

fn try_join(self) -> Self::Future

source§

impl<ERR, A, ResA, B, ResB, C, ResC> TryJoin for (A, B, C)where A: IntoFuture<Output = Result<ResA, ERR>>, B: IntoFuture<Output = Result<ResB, ERR>>, C: IntoFuture<Output = Result<ResC, ERR>>,

§

type Output = (ResA, ResB, ResC)

§

type Error = ERR

§

type Future = TryJoin3<<A as IntoFuture>::IntoFuture, ResA, <B as IntoFuture>::IntoFuture, ResB, <C as IntoFuture>::IntoFuture, ResC>

source§

fn try_join(self) -> Self::Future

source§

impl<ERR, A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, F, ResF> TryJoin for (A, B, C, D, E, F)where A: IntoFuture<Output = Result<ResA, ERR>>, B: IntoFuture<Output = Result<ResB, ERR>>, C: IntoFuture<Output = Result<ResC, ERR>>, D: IntoFuture<Output = Result<ResD, ERR>>, E: IntoFuture<Output = Result<ResE, ERR>>, F: IntoFuture<Output = Result<ResF, ERR>>,

§

type Output = (ResA, ResB, ResC, ResD, ResE, ResF)

§

type Error = ERR

§

type Future = TryJoin6<<A as IntoFuture>::IntoFuture, ResA, <B as IntoFuture>::IntoFuture, ResB, <C as IntoFuture>::IntoFuture, ResC, <D as IntoFuture>::IntoFuture, ResD, <E as IntoFuture>::IntoFuture, ResE, <F as IntoFuture>::IntoFuture, ResF>

source§

fn try_join(self) -> Self::Future

source§

impl<ERR, A, ResA, B, ResB, C, ResC, D, ResD> TryJoin for (A, B, C, D)where A: IntoFuture<Output = Result<ResA, ERR>>, B: IntoFuture<Output = Result<ResB, ERR>>, C: IntoFuture<Output = Result<ResC, ERR>>, D: IntoFuture<Output = Result<ResD, ERR>>,

§

type Output = (ResA, ResB, ResC, ResD)

§

type Error = ERR

§

type Future = TryJoin4<<A as IntoFuture>::IntoFuture, ResA, <B as IntoFuture>::IntoFuture, ResB, <C as IntoFuture>::IntoFuture, ResC, <D as IntoFuture>::IntoFuture, ResD>

source§

fn try_join(self) -> Self::Future

Implementors§