Struct futures_util::stream::select_all::SelectAll [−][src]
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]
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]
Returns the number of streams contained in the set.
This represents the total number of in-flight streams.
pub fn is_empty(&self) -> bool
[src]
Returns true
if the set contains no streams
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]
Returns an iterator that allows inspecting each stream in the set.
pub fn iter_mut(&mut self) -> IterMut<'_, St>ⓘ
[src]
Returns an iterator that allows modifying each stream in the set.
pub fn clear(&mut self)
[src]
Clears the set, removing all streams.
Trait Implementations
impl<St: Debug> Debug for SelectAll<St>
[src]
impl<St: Stream + Unpin> Default 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]
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl<St: Stream + Unpin> FromIterator<St> for SelectAll<St>
[src]
fn from_iter<T: IntoIterator<Item = St>>(iter: T) -> Self
[src]
impl<St: Stream + Unpin> FusedStream for SelectAll<St>
[src]
fn is_terminated(&self) -> bool
[src]
impl<St: Stream + Unpin> IntoIterator for SelectAll<St>
[src]
type Item = St
The type of the elements being iterated over.
type IntoIter = IntoIter<St>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a, St: Stream + Unpin> IntoIterator for &'a SelectAll<St>
[src]
type Item = &'a St
The type of the elements being iterated over.
type IntoIter = Iter<'a, St>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a, St: Stream + Unpin> IntoIterator for &'a mut SelectAll<St>
[src]
type Item = &'a mut St
The type of the elements being iterated over.
type IntoIter = IterMut<'a, St>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<St: Stream + Unpin> Stream for SelectAll<St>
[src]
type Item = St::Item
Values yielded by the stream.
fn poll_next(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Self::Item>>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Self::Item>>
pub fn size_hint(&self) -> (usize, Option<usize>)
[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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<S, T, E> TryStream for S where
S: Stream<Item = Result<T, E>> + ?Sized,
[src]
S: Stream<Item = Result<T, E>> + ?Sized,