Struct SelectAll
#[must_use = "streams do nothing unless polled"]
pub struct SelectAll<St> { /* private fields */ }
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>
fn new() -> SelfConstructs a new, empty
SelectAllThe returned
SelectAlldoes not contain any streams and, in this state,SelectAll::pollwill returnPoll::Ready(None).fn len(&self) -> usizeReturns the number of streams contained in the set.
This represents the total number of in-flight streams.
fn is_empty(&self) -> boolReturns
trueif the set contains no streamsfn push(&mut self, stream: St)Push a stream into the set.
This function submits the given stream to the set for managing. This function will not call
pollon the submitted stream. The caller must ensure thatSelectAll::pollis called in order to receive task notifications.fn iter(&self) -> Iter<'_, St>Returns an iterator that allows inspecting each stream in the set.
fn iter_mut(&mut self) -> IterMut<'_, St>Returns an iterator that allows modifying each stream in the set.
fn clear(&mut self)Clears the set, removing all streams.
Trait Implementations
impl<St: Debug> Debug for SelectAll<St>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<St: Stream + Unpin> Default for SelectAll<St>
fn default() -> Self
impl<St: Stream + Unpin> Extend<St> for SelectAll<St>
fn extend<T: IntoIterator<Item = St>>(&mut self, iter: T)
impl<St: Stream + Unpin> FromIterator<St> for SelectAll<St>
fn from_iter<T: IntoIterator<Item = St>>(iter: T) -> Self
impl<St: Stream + Unpin> FusedStream for SelectAll<St>
fn is_terminated(&self) -> bool
impl<St: Stream + Unpin> IntoIterator for SelectAll<St>
type Item = St;type IntoIter = IntoIter<St>;fn into_iter(self) -> Self::IntoIter
impl<St: Stream + Unpin> Stream for SelectAll<St>
type Item = <St as Stream>::Item;fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>
Auto Trait Implementations
impl<St> !Freeze for SelectAll<St>
impl<St> !RefUnwindSafe for SelectAll<St>
impl<St> !UnwindSafe for SelectAll<St>
impl<St> Send for SelectAll<St>
where
FuturesUnordered<StreamFuture<St>>: Send,
impl<St> Sync for SelectAll<St>
where
FuturesUnordered<StreamFuture<St>>: Sync,
impl<St> Unpin for SelectAll<St>
where
FuturesUnordered<StreamFuture<St>>: Unpin,
impl<St> UnsafeUnpin for SelectAll<St>
where
FuturesUnordered<StreamFuture<St>>: UnsafeUnpin,
Blanket Implementations
impl<S> TryStreamExt for SelectAll<St>
where
S: TryStream + ?Sized,
impl<S, T, E> TryStream for SelectAll<St>
where
S: Stream<Item = Result<T, E>> + ?Sized,
type Ok = T;type Error = E;fn try_poll_next(self: Pin<&mut S>, cx: &mut Context<'_>) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>
impl<T> Any for SelectAll<St>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for SelectAll<St>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for SelectAll<St>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for SelectAll<St>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> StreamExt for SelectAll<St>
where
T: Stream + ?Sized,
impl<T, U> Into<U> for SelectAll<St>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for SelectAll<St>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for SelectAll<St>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>