pub struct SelectAll<F: Future> { /* private fields */ }
Expand description
An unbounded set of futures.
Implementations§
Source§impl<F: Future> SelectAll<F>
impl<F: Future> SelectAll<F>
Sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a new, empty SelectAll
.
The returned SelectAll
does not contain any futures.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of futures contained in the set. This represents the total number of in-flight futures.
Sourcepub fn push(&mut self, future: F)
pub fn push(&mut self, future: F)
Push a future into the set.
This function submits the given future to the set for managing.
This function will not call poll on the submitted future.
The caller must ensure that SelectAll::select
is called in order to receive task notifications.
Sourcepub async fn select(&mut self) -> F::Output
pub async fn select(&mut self) -> F::Output
Select over a list of futures.
Upon completion the item resolved will be returned.
There are no guarantees provided on the order of the list with the remaining futures. They might be swapped around, reversed, or completely random.
§Panics
This function will panic if the SelectAll
specified contains no items.