a10
a10 copied to clipboard
Add support for chaining
Not sure what the API would look like, maybe something like the following:
fn chain<Fut1, Fut2, ...>((&mut Fut1, &mut Fut2, &mut Fut2)) -> Chain;
struct Chain<Futs> {
futures: Futs,
}
impl Future for Chain {
type Output = ();
fn poll() {
// Submit entries to queue for all futures, then return.
}
}
Usage:
let fut1 = file.write(buf);
let fut2 = file.sync();
chain(&mut fut1, &mut fut2).await;
fut1.await?;
fut2.await?;