Struct futures_util::stream::select_all::SelectAll [−][src]
#[must_use = "streams do nothing unless polled"]pub struct SelectAll<St> { /* fields omitted */ }
Expand description
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.
Implementations
impl<St: Stream + Unpin> SelectAll<St>[src]
impl<St: Stream + Unpin> SelectAll<St>[src]pub fn new() -> Self[src]
pub fn new() -> Self[src]Constructs a new, empty SelectAll
The returned SelectAll does not contain any streams and, in this
state, SelectAll::poll will return Poll::Ready(None).
pub fn len(&self) -> usize[src]
pub fn len(&self) -> usize[src]Returns the number of streams contained in the set.
This represents the total number of in-flight streams.
pub fn push(&mut self, stream: St)[src]
pub fn push(&mut self, stream: St)[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.
pub fn iter(&self) -> Iter<'_, St>ⓘ[src]
pub fn iter(&self) -> Iter<'_, St>ⓘ[src]Returns an iterator that allows inspecting each stream in the set.
Trait Implementations
impl<St: Stream + Unpin> Extend<St> for SelectAll<St>[src]
impl<St: Stream + Unpin> Extend<St> for SelectAll<St>[src]fn extend<T: IntoIterator<Item = St>>(&mut self, iter: T)[src]
fn extend<T: IntoIterator<Item = St>>(&mut self, iter: T)[src]Extends a collection with the contents of an iterator. Read more
fn extend_one(&mut self, item: A)[src]
fn extend_one(&mut self, item: A)[src]extend_one)Extends a collection with exactly one element.
fn extend_reserve(&mut self, additional: usize)[src]
fn extend_reserve(&mut self, additional: usize)[src]extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
impl<St: Stream + Unpin> FromIterator<St> for SelectAll<St>[src]
impl<St: Stream + Unpin> FromIterator<St> for SelectAll<St>[src]fn from_iter<T: IntoIterator<Item = St>>(iter: T) -> Self[src]
fn from_iter<T: IntoIterator<Item = St>>(iter: T) -> Self[src]Creates a value from an iterator. Read more
impl<St: Stream + Unpin> FusedStream for SelectAll<St>[src]
impl<St: Stream + Unpin> FusedStream for SelectAll<St>[src]fn is_terminated(&self) -> bool[src]
fn is_terminated(&self) -> bool[src]Returns true if the stream should no longer be polled.
impl<St: Stream + Unpin> IntoIterator for SelectAll<St>[src]
impl<St: Stream + Unpin> IntoIterator for SelectAll<St>[src]impl<'a, St: Stream + Unpin> IntoIterator for &'a SelectAll<St>[src]
impl<'a, St: Stream + Unpin> IntoIterator for &'a SelectAll<St>[src]impl<'a, St: Stream + Unpin> IntoIterator for &'a mut SelectAll<St>[src]
impl<'a, St: Stream + Unpin> IntoIterator for &'a mut SelectAll<St>[src]impl<St: Stream + Unpin> Stream for SelectAll<St>[src]
impl<St: Stream + Unpin> Stream for SelectAll<St>[src]impl<'__pin, St> Unpin for SelectAll<St> where
__Origin<'__pin, St>: Unpin, [src]
__Origin<'__pin, St>: Unpin,
Auto Trait Implementations
impl<St> !RefUnwindSafe for SelectAll<St>
impl<St> Send for SelectAll<St> where
St: Send,
St: Send,
impl<St> Sync for SelectAll<St> where
St: Sync,
St: Sync,
impl<St> !UnwindSafe for SelectAll<St>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more