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 committed Feb 26, 2021
1 parent 74ff5a1 commit 0afeda1
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 0afeda1

Please sign in to comment.