Skip to main content

try_join

Macro try_join 

Source
macro_rules! try_join {
    ($($future:expr),+ $(,)?) => { ... };
}
Expand description

Joins multiple futures, short-circuiting on the first error.

Unlike join! which waits for all futures, try_join! cancels remaining futures when any future returns an error.

§Semantics

let (a, b, c) = try_join!(fut_a, fut_b, fut_c).await?;
  • If all succeed: return tuple of values
  • If any fails: cancel remaining, return first error
  • If any panics: cancel remaining, return Panicked