futures_concurrency::future

Trait TryJoin

source
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 TryJoin for ()

source§

type Output = ()

source§

type Error = Infallible

source§

type Future = TryJoin0

source§

fn try_join(self) -> Self::Future

source§

impl<A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, Err> 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>>,

source§

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

source§

type Error = Err

source§

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, Err>

source§

fn try_join(self) -> Self::Future

source§

impl<A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, F, ResF, Err> 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>>,

source§

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

source§

type Error = Err

source§

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, Err>

source§

fn try_join(self) -> Self::Future

source§

impl<A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, F, ResF, G, ResG, Err> 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>>,

source§

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

source§

type Error = Err

source§

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, Err>

source§

fn try_join(self) -> Self::Future

source§

impl<A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, F, ResF, G, ResG, H, ResH, Err> 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>>,

source§

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

source§

type Error = Err

source§

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, Err>

source§

fn try_join(self) -> Self::Future

source§

impl<A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, F, ResF, G, ResG, H, ResH, I, ResI, Err> 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>>,

source§

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

source§

type Error = Err

source§

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, Err>

source§

fn try_join(self) -> Self::Future

source§

impl<A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, F, ResF, G, ResG, H, ResH, I, ResI, J, ResJ, Err> 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>>,

source§

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

source§

type Error = Err

source§

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, Err>

source§

fn try_join(self) -> Self::Future

source§

impl<A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, F, ResF, G, ResG, H, ResH, I, ResI, J, ResJ, K, ResK, Err> 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>>,

source§

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

source§

type Error = Err

source§

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, Err>

source§

fn try_join(self) -> Self::Future

source§

impl<A, ResA, B, ResB, C, ResC, D, ResD, E, ResE, F, ResF, G, ResG, H, ResH, I, ResI, J, ResJ, K, ResK, L, ResL, Err> 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>>,

source§

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

source§

type Error = Err

source§

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, Err>

source§

fn try_join(self) -> Self::Future

source§

impl<A, ResA, B, ResB, C, ResC, D, ResD, Err> 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>>,

source§

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

source§

type Error = Err

source§

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

source§

fn try_join(self) -> Self::Future

source§

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

source§

type Output = (ResA, ResB, ResC)

source§

type Error = Err

source§

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

source§

fn try_join(self) -> Self::Future

source§

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

source§

type Output = (ResA, ResB)

source§

type Error = Err

source§

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

source§

fn try_join(self) -> Self::Future

source§

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

source§

type Output = (ResA,)

source§

type Error = Err

source§

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

source§

fn try_join(self) -> Self::Future

source§

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

source§

type Output = Vec<T>

source§

type Error = E

source§

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

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>>,

source§

type Output = [T; N]

source§

type Error = E

source§

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

source§

fn try_join(self) -> Self::Future

Implementors§