Skip to content

Commit 33677fe

Browse files
stepanchegtaiki-e
authored andcommitted
Add future::SelectAll::into_inner (#2363)
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.
1 parent c91f869 commit 33677fe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

futures-util/src/future/select_all.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ pub fn select_all<I>(iter: I) -> SelectAll<I::Item>
4242
assert_future::<(<I::Item as Future>::Output, usize, Vec<I::Item>), _>(ret)
4343
}
4444

45+
impl<Fut> SelectAll<Fut> {
46+
/// Consumes this combinator, returning the underlying futures.
47+
pub fn into_inner(self) -> Vec<Fut> {
48+
self.inner
49+
}
50+
}
51+
4552
impl<Fut: Future + Unpin> Future for SelectAll<Fut> {
4653
type Output = (Fut::Output, usize, Vec<Fut>);
4754

0 commit comments

Comments
 (0)