[−][src]Trait parallel_stream::prelude::ParallelStream
Parallel version of the standard Stream
trait.
Associated Types
Loading content...Required methods
fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>>
Attempts to receive the next item from the stream.
fn limit(self, limit: impl Into<Option<usize>>) -> Self
Set a max concurrency limit
fn get_limit(&self) -> Option<usize>
Get the max concurrency limit
Provided methods
fn map<F, T, Fut>(self, f: F) -> Map<T> where
F: FnMut(Self::Item) -> Fut + Send + Sync + Copy + 'static,
T: Send + 'static,
Fut: Future<Output = T> + Send,
F: FnMut(Self::Item) -> Fut + Send + Sync + Copy + 'static,
T: Send + 'static,
Fut: Future<Output = T> + Send,
Applies f
to each item of this stream in parallel, producing a new
stream with the results.
fn next(&mut self) -> NextFuture<Self>
Applies f
to each item of this stream in parallel, producing a new
stream with the results.
fn take(self, n: usize) -> Take<Self> where
Self: Sized,
Self: Sized,
Creates a stream that yields its first n
elements.
fn for_each<F, Fut>(self, f: F) -> ForEach where
F: FnMut(Self::Item) -> Fut + Send + Sync + Copy + 'static,
Fut: Future<Output = ()> + Send,
F: FnMut(Self::Item) -> Fut + Send + Sync + Copy + 'static,
Fut: Future<Output = ()> + Send,
Applies f
to each item of this stream in parallel.
fn collect<'a, B>(self) -> Pin<Box<dyn Future<Output = B> + Send + 'a>> where
Self: Sized + 'a,
B: FromParallelStream<Self::Item>,
Self: Sized + 'a,
B: FromParallelStream<Self::Item>,
Transforms a stream into a collection.
collect()
can take anything streamable, and turn it into a relevant
collection. This is one of the more powerful methods in the async
standard library, used in a variety of contexts.
Implementors
impl<S: ParallelStream> ParallelStream for Take<S>
[src]
type Item = S::Item
fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<S::Item>>
[src]
fn limit(self, limit: impl Into<Option<usize>>) -> Self
[src]
fn get_limit(&self) -> Option<usize>
[src]
impl<S: Stream + Send + Sync + Unpin + 'static> ParallelStream for FromStream<S> where
S::Item: Send,
[src]
S::Item: Send,