[][src]Trait parallel_stream::ParallelStream

pub trait ParallelStream: Sized + Send + Sync + Unpin + 'static {
    type Item: Send;
    fn poll_next(
        self: Pin<&mut Self>,
        cx: &mut Context
    ) -> Poll<Option<Self::Item>>; 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
, { ... }
fn next(&mut self) -> NextFuture<Self> { ... }
fn take(self, n: usize) -> Take<Self>
    where
        Self: Sized
, { ... }
fn for_each<F, Fut>(self, f: F) -> ForEach
    where
        F: FnMut(Self::Item) -> Fut + Send + Sync + Copy + 'static,
        Fut: Future<Output = ()> + Send
, { ... } }

Parallel version of the standard Stream trait.

Associated Types

type Item: Send

The type of items yielded by this stream.

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.

Loading content...

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

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

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

Applies f to each item of this stream in parallel.

Loading content...

Implementors

impl<S: ParallelStream> ParallelStream for Take<S>[src]

type Item = S::Item

impl<S: Stream + Send + Sync + Unpin + 'static> ParallelStream for FromStream<S> where
    S::Item: Send
[src]

type Item = S::Item

impl<T: Send + 'static> ParallelStream for Map<T>[src]

type Item = T

impl<T: Send + Sync + 'static> ParallelStream for IntoParStream<T>[src]

type Item = T

Loading content...