[−][src]Macro join::try_join_async
Use to combine futures. It transposes tuple of Result
s into Result
of tuple or single Result
in
case of 1 branch.
Example:
#![recursion_limit="256"] extern crate join; extern crate futures; use join::try_join_async; use futures::future::ok; #[tokio::main] async fn main() { let product = try_join_async! { ok::<_,()>(2u16) => |v| ok::<_,()>(v + 2u16), ok::<_,()>(3u16), ok::<_,()>(4u16), map => |a, b, c| a * b * c }.await.unwrap(); assert_eq!(product, 48); }