Struct futures::stream::SelectAll [] [src]

#[must_use = "streams do nothing unless polled"]
pub struct SelectAll<S> { /* fields omitted */ }

An unbounded set of streams

This "combinator" provides the ability to maintain a set of streams and drive them all to completion.

Streams are pushed into this set and their realized values are yielded as they become ready. Streams will only be polled when they generate notifications. This allows to coordinate a large number of streams.

Note that you can create a ready-made SelectAll via the select_all function in the stream module, or you can start with an empty set with the SelectAll::new constructor.

Methods

impl<S> SelectAll<S> where
    S: Stream
[src]

[src]

Constructs a new, empty SelectAll

The returned SelectAll does not contain any streams and, in this state, SelectAll::poll will return Ok(Async::Ready(None)).

[src]

Returns the number of streams contained in the set.

This represents the total number of in-flight streams.

[src]

Returns true if the set contains no streams

[src]

Push a stream into the set.

This function submits the given stream to the set for managing. This function will not call poll on the submitted stream. The caller must ensure that SelectAll::poll is called in order to receive task notifications.

Trait Implementations

impl<T> Debug for SelectAll<T> where
    T: Debug
[src]

[src]

Formats the value using the given formatter. Read more

impl<S> Stream for SelectAll<S> where
    S: Stream
[src]

Values yielded by the stream.

Errors yielded by the stream.

[src]

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more

Auto Trait Implementations

impl<S> Send for SelectAll<S> where
    S: Send

impl<S> Sync for SelectAll<S> where
    S: Sync