Skip to content

Commit

Permalink
Add future::SelectAll::into_inner (#2363)
Browse files Browse the repository at this point in the history
When select all is not yet finished (for example, due to timeout),
underlying futures may need to be extracted to be updated to construct
a fresh select all.
  • Loading branch information
stepancheg authored and taiki-e committed Apr 10, 2021
1 parent c91f869 commit 33677fe
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions futures-util/src/future/select_all.rs
Expand Up @@ -42,6 +42,13 @@ pub fn select_all<I>(iter: I) -> SelectAll<I::Item>
assert_future::<(<I::Item as Future>::Output, usize, Vec<I::Item>), _>(ret)
}

impl<Fut> SelectAll<Fut> {
/// Consumes this combinator, returning the underlying futures.
pub fn into_inner(self) -> Vec<Fut> {
self.inner
}
}

impl<Fut: Future + Unpin> Future for SelectAll<Fut> {
type Output = (Fut::Output, usize, Vec<Fut>);

Expand Down

0 comments on commit 33677fe

Please sign in to comment.