lucidd / rust-promise

A future/promise library for rust
20 stars 2 forks source link

Implement first_of and all functions for tuples. #6

Open lucidd opened 10 years ago

lucidd commented 10 years ago

It woud look something like this.

fn first_of((a:Future<A>, b: Future<A>)) -> Future<A>;
fn all((a:Future<A>, b: Future<B>)) -> Future<(A, B)>;

first_of is restricted to tuples with only 1 type of Future. This is basically the same as the first_of for Vec but with better match ergonomics for the result.

Both functions should be available for for all tuple sizes.