Struct SelectAll

Source
pub struct SelectAll<F: Future> { /* private fields */ }
Expand description

An unbounded set of futures.

Implementations§

Source§

impl<F: Future> SelectAll<F>

Source

pub fn new() -> Self

Constructs a new, empty SelectAll. The returned SelectAll does not contain any futures.

Source

pub fn len(&self) -> usize

Returns the number of futures contained in the set. This represents the total number of in-flight futures.

Source

pub fn is_empty(&self) -> bool

Returns true if the set contains no futures.

Source

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.

Source

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.

Trait Implementations§

Source§

impl<I> From<I> for SelectAll<I::Item>
where I: IntoIterator, I::Item: Future,

Source§

fn from(iter: I) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<F> Freeze for SelectAll<F>

§

impl<F> RefUnwindSafe for SelectAll<F>
where F: RefUnwindSafe,

§

impl<F> Send for SelectAll<F>
where F: Send,

§

impl<F> Sync for SelectAll<F>
where F: Sync,

§

impl<F> Unpin for SelectAll<F>
where F: Unpin,

§

impl<F> UnwindSafe for SelectAll<F>
where F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.