c-async-await—concurrent futures 161 This function takes a collection of futures as an argument and returns a Join All<F> future. The function simply creates a new collection. In this collection, we will have tuples consisting of the original futures we received and a bool value indicating whether the future is resolved or not. Next, we have the definition of our Join All struct: ch07/c-async-await/src/future. rs pub struct Join All<F: Future> { futures: Vec<(bool, F)>, finished_count: usize, } This struct will simply store the collection we created and a finished_count. The last field will make it a little bit easier to keep track of how many futures have been resolved. As we're getting used to by now, most of the interesting parts happen in the Future implementation for Join All : impl<F: Future> Future for Join All<F> { type Output = String; fn poll(&mut self)-> Poll State<Self::Output> { for (finished, fut) in self. futures. iter_mut() { if *finished { continue; } match fut. poll() { Poll State::Ready(_) => { *finished = true; self. finished_count += 1; } Poll State::Not Ready => continue, } } if self. finished_count == self. futures. len() { Poll State::Ready(String::new()) } else { Poll State::Not Ready } } }