Struct sea_streamer::export::futures::prelude::stream::select_all::SelectAll
source ยท pub struct SelectAll<St> { /* private fields */ }
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ยง
sourceยงimpl<St> SelectAll<St>
impl<St> SelectAll<St>
sourcepub fn new() -> SelectAll<St>
pub fn new() -> SelectAll<St>
Constructs a new, empty SelectAll
The returned SelectAll
does not contain any streams and, in this
state, SelectAll::poll
will return Poll::Ready(None)
.
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of streams contained in the set.
This represents the total number of in-flight streams.
sourcepub fn push(&mut self, stream: St)
pub fn 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 poll
on the submitted stream. The caller must
ensure that SelectAll::poll
is called in order to receive task
notifications.
sourcepub fn iter(&self) -> Iter<'_, St> โ
pub fn iter(&self) -> Iter<'_, St> โ
Returns an iterator that allows inspecting each stream in the set.
Trait Implementationsยง
sourceยงimpl<St> Extend<St> for SelectAll<St>
impl<St> Extend<St> for SelectAll<St>
sourceยงfn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = St>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = St>,
sourceยงfn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)sourceยงfn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)sourceยงimpl<St> FromIterator<St> for SelectAll<St>
impl<St> FromIterator<St> for SelectAll<St>
sourceยงimpl<St> FusedStream for SelectAll<St>
impl<St> FusedStream for SelectAll<St>
sourceยงfn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
true
if the stream should no longer be polled.sourceยงimpl<'a, St> IntoIterator for &'a SelectAll<St>
impl<'a, St> IntoIterator for &'a SelectAll<St>
sourceยงimpl<'a, St> IntoIterator for &'a mut SelectAll<St>
impl<'a, St> IntoIterator for &'a mut SelectAll<St>
sourceยงimpl<St> IntoIterator for SelectAll<St>
impl<St> IntoIterator for SelectAll<St>
sourceยงimpl<St> Stream for SelectAll<St>
impl<St> Stream for SelectAll<St>
sourceยงfn poll_next(
self: Pin<&mut SelectAll<St>>,
cx: &mut Context<'_>
) -> Poll<Option<<SelectAll<St> as Stream>::Item>>
fn poll_next( self: Pin<&mut SelectAll<St>>, cx: &mut Context<'_> ) -> Poll<Option<<SelectAll<St> as Stream>::Item>>
None
if the stream is exhausted. Read moreAuto Trait Implementationsยง
impl<St> !Freeze for SelectAll<St>
impl<St> !RefUnwindSafe for SelectAll<St>
impl<St> Send for SelectAll<St>where
St: Send,
impl<St> Sync for SelectAll<St>
impl<St> Unpin for SelectAll<St>
impl<St> !UnwindSafe for SelectAll<St>
Blanket Implementationsยง
sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceยงimpl<T> StreamExt for T
impl<T> StreamExt for T
sourceยงfn next(&mut self) -> Next<'_, Self> โwhere
Self: Unpin,
fn next(&mut self) -> Next<'_, Self> โwhere
Self: Unpin,
sourceยงfn into_future(self) -> StreamFuture<Self> โ
fn into_future(self) -> StreamFuture<Self> โ
sourceยงfn map<T, F>(self, f: F) -> Map<Self, F>
fn map<T, F>(self, f: F) -> Map<Self, F>
sourceยงfn enumerate(self) -> Enumerate<Self>where
Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
sourceยงfn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>
fn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>
sourceยงfn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F>
fn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F>
sourceยงfn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
sourceยงfn collect<C>(self) -> Collect<Self, C> โ
fn collect<C>(self) -> Collect<Self, C> โ
sourceยงfn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB> โ
fn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB> โ
sourceยงfn concat(self) -> Concat<Self> โ
fn concat(self) -> Concat<Self> โ
sourceยงfn count(self) -> Count<Self> โwhere
Self: Sized,
fn count(self) -> Count<Self> โwhere
Self: Sized,
sourceยงfn fold<T, Fut, F>(self, init: T, f: F) -> Fold<Self, Fut, T, F> โ
fn fold<T, Fut, F>(self, init: T, f: F) -> Fold<Self, Fut, T, F> โ
sourceยงfn any<Fut, F>(self, f: F) -> Any<Self, Fut, F> โ
fn any<Fut, F>(self, f: F) -> Any<Self, Fut, F> โ
true
if any element in stream satisfied a predicate. Read moresourceยงfn all<Fut, F>(self, f: F) -> All<Self, Fut, F> โ
fn all<Fut, F>(self, f: F) -> All<Self, Fut, F> โ
true
if all element in stream satisfied a predicate. Read moresourceยงfn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
sourceยงfn flatten_unordered(
self,
limit: impl Into<Option<usize>>
) -> FlattenUnorderedWithFlowController<Self, ()>
fn flatten_unordered( self, limit: impl Into<Option<usize>> ) -> FlattenUnorderedWithFlowController<Self, ()>
sourceยงfn flat_map_unordered<U, F>(
self,
limit: impl Into<Option<usize>>,
f: F
) -> FlatMapUnordered<Self, U, F>
fn flat_map_unordered<U, F>( self, limit: impl Into<Option<usize>>, f: F ) -> FlatMapUnordered<Self, U, F>
StreamExt::map
but flattens nested Stream
s
and polls them concurrently, yielding items in any order, as they made
available. Read moresourceยงfn scan<S, B, Fut, F>(self, initial_state: S, f: F) -> Scan<Self, S, Fut, F>
fn scan<S, B, Fut, F>(self, initial_state: S, f: F) -> Scan<Self, S, Fut, F>
StreamExt::fold
that holds internal state
and produces a new stream. Read moresourceยงfn skip_while<Fut, F>(self, f: F) -> SkipWhile<Self, Fut, F>
fn skip_while<Fut, F>(self, f: F) -> SkipWhile<Self, Fut, F>
true
. Read moresourceยงfn take_while<Fut, F>(self, f: F) -> TakeWhile<Self, Fut, F>
fn take_while<Fut, F>(self, f: F) -> TakeWhile<Self, Fut, F>
true
. Read moresourceยงfn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>
fn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>
sourceยงfn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F> โ
fn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F> โ
sourceยงfn for_each_concurrent<Fut, F>(
self,
limit: impl Into<Option<usize>>,
f: F
) -> ForEachConcurrent<Self, Fut, F> โ
fn for_each_concurrent<Fut, F>( self, limit: impl Into<Option<usize>>, f: F ) -> ForEachConcurrent<Self, Fut, F> โ
sourceยงfn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
n
items of the underlying stream. Read moresourceยงfn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
n
items of the underlying stream. Read moresourceยงfn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
sourceยงfn boxed<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + Send + 'a>>
fn boxed<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + Send + 'a>>
sourceยงfn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a>>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a>>where
Self: Sized + 'a,
sourceยงfn buffered(self, n: usize) -> Buffered<Self>
fn buffered(self, n: usize) -> Buffered<Self>
sourceยงfn buffer_unordered(self, n: usize) -> BufferUnordered<Self>
fn buffer_unordered(self, n: usize) -> BufferUnordered<Self>
sourceยงfn zip<St>(self, other: St) -> Zip<Self, St>
fn zip<St>(self, other: St) -> Zip<Self, St>
sourceยงfn peekable(self) -> Peekable<Self>where
Self: Sized,
fn peekable(self) -> Peekable<Self>where
Self: Sized,
peek
method. Read moresourceยงfn chunks(self, capacity: usize) -> Chunks<Self>where
Self: Sized,
fn chunks(self, capacity: usize) -> Chunks<Self>where
Self: Sized,
sourceยงfn ready_chunks(self, capacity: usize) -> ReadyChunks<Self>where
Self: Sized,
fn ready_chunks(self, capacity: usize) -> ReadyChunks<Self>where
Self: Sized,
sourceยงfn forward<S>(self, sink: S) -> Forward<Self, S> โ
fn forward<S>(self, sink: S) -> Forward<Self, S> โ
sourceยงfn split<Item>(self) -> (SplitSink<Self, Item>, SplitStream<Self>)
fn split<Item>(self) -> (SplitSink<Self, Item>, SplitStream<Self>)
sourceยงfn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
sourceยงfn left_stream<B>(self) -> Either<Self, B> โ
fn left_stream<B>(self) -> Either<Self, B> โ
sourceยงfn right_stream<B>(self) -> Either<B, Self> โ
fn right_stream<B>(self) -> Either<B, Self> โ
sourceยงfn poll_next_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>where
Self: Unpin,
fn poll_next_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>where
Self: Unpin,
Stream::poll_next
on Unpin
stream types.sourceยงfn select_next_some(&mut self) -> SelectNextSome<'_, Self> โwhere
Self: Unpin + FusedStream,
fn select_next_some(&mut self) -> SelectNextSome<'_, Self> โwhere
Self: Unpin + FusedStream,
sourceยงimpl<S> TryStreamExt for S
impl<S> TryStreamExt for S
sourceยงfn err_into<E>(self) -> ErrInto<Self, E>
fn err_into<E>(self) -> ErrInto<Self, E>
sourceยงfn map_ok<T, F>(self, f: F) -> MapOk<Self, F>
fn map_ok<T, F>(self, f: F) -> MapOk<Self, F>
sourceยงfn map_err<E, F>(self, f: F) -> MapErr<Self, F>
fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
sourceยงfn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
f
. Read moresourceยงfn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F>
fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F>
f
. Read moresourceยงfn inspect_ok<F>(self, f: F) -> InspectOk<Self, F>
fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F>
sourceยงfn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
sourceยงfn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
sourceยงfn try_next(&mut self) -> TryNext<'_, Self> โwhere
Self: Unpin,
fn try_next(&mut self) -> TryNext<'_, Self> โwhere
Self: Unpin,
sourceยงfn try_for_each<Fut, F>(self, f: F) -> TryForEach<Self, Fut, F> โ
fn try_for_each<Fut, F>(self, f: F) -> TryForEach<Self, Fut, F> โ
sourceยงfn try_skip_while<Fut, F>(self, f: F) -> TrySkipWhile<Self, Fut, F>
fn try_skip_while<Fut, F>(self, f: F) -> TrySkipWhile<Self, Fut, F>
true
. Read moresourceยงfn try_take_while<Fut, F>(self, f: F) -> TryTakeWhile<Self, Fut, F>
fn try_take_while<Fut, F>(self, f: F) -> TryTakeWhile<Self, Fut, F>
true
. Read moresourceยงfn try_for_each_concurrent<Fut, F>(
self,
limit: impl Into<Option<usize>>,
f: F
) -> TryForEachConcurrent<Self, Fut, F> โ
fn try_for_each_concurrent<Fut, F>( self, limit: impl Into<Option<usize>>, f: F ) -> TryForEachConcurrent<Self, Fut, F> โ
sourceยงfn try_collect<C>(self) -> TryCollect<Self, C> โ
fn try_collect<C>(self) -> TryCollect<Self, C> โ
sourceยงfn try_chunks(self, capacity: usize) -> TryChunks<Self>where
Self: Sized,
fn try_chunks(self, capacity: usize) -> TryChunks<Self>where
Self: Sized,
sourceยงfn try_ready_chunks(self, capacity: usize) -> TryReadyChunks<Self>where
Self: Sized,
fn try_ready_chunks(self, capacity: usize) -> TryReadyChunks<Self>where
Self: Sized,
sourceยงfn try_filter<Fut, F>(self, f: F) -> TryFilter<Self, Fut, F>
fn try_filter<Fut, F>(self, f: F) -> TryFilter<Self, Fut, F>
sourceยงfn try_filter_map<Fut, F, T>(self, f: F) -> TryFilterMap<Self, Fut, F>
fn try_filter_map<Fut, F, T>(self, f: F) -> TryFilterMap<Self, Fut, F>
sourceยงfn try_flatten_unordered(
self,
limit: impl Into<Option<usize>>
) -> TryFlattenUnordered<Self>
fn try_flatten_unordered( self, limit: impl Into<Option<usize>> ) -> TryFlattenUnordered<Self>
sourceยงfn try_flatten(self) -> TryFlatten<Self>
fn try_flatten(self) -> TryFlatten<Self>
sourceยงfn try_fold<T, Fut, F>(self, init: T, f: F) -> TryFold<Self, Fut, T, F> โ
fn try_fold<T, Fut, F>(self, init: T, f: F) -> TryFold<Self, Fut, T, F> โ
sourceยงfn try_concat(self) -> TryConcat<Self> โ
fn try_concat(self) -> TryConcat<Self> โ
sourceยงfn try_buffer_unordered(self, n: usize) -> TryBufferUnordered<Self>
fn try_buffer_unordered(self, n: usize) -> TryBufferUnordered<Self>
sourceยงfn try_buffered(self, n: usize) -> TryBuffered<Self>
fn try_buffered(self, n: usize) -> TryBuffered<Self>
sourceยงfn try_poll_next_unpin(
&mut self,
cx: &mut Context<'_>
) -> Poll<Option<Result<Self::Ok, Self::Error>>>where
Self: Unpin,
fn try_poll_next_unpin(
&mut self,
cx: &mut Context<'_>
) -> Poll<Option<Result<Self::Ok, Self::Error>>>where
Self: Unpin,
TryStream::try_poll_next
on Unpin
stream types.sourceยงfn into_async_read(self) -> IntoAsyncRead<Self>
fn into_async_read(self) -> IntoAsyncRead<Self>
AsyncBufRead
. Read moresourceยงfn try_all<Fut, F>(self, f: F) -> TryAll<Self, Fut, F> โ
fn try_all<Fut, F>(self, f: F) -> TryAll<Self, Fut, F> โ
Err
is encountered or if an Ok
item is found
that does not satisfy the predicate. Read more