pub struct Take<S> { /* private fields */ }
Expand description
A stream that yields the first n
items of another stream.
This struct
is created by the take
method on ParallelStream
. See its
documentation for more.
Trait Implementations§
Source§impl<S: ParallelStream> ParallelStream for Take<S>
impl<S: ParallelStream> ParallelStream for Take<S>
Source§type Item = <S as ParallelStream>::Item
type Item = <S as ParallelStream>::Item
The type of items yielded by this stream.
Source§fn poll_next(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Option<S::Item>>
fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<S::Item>>
Attempts to receive the next item from the stream.
Source§fn map<F, T, Fut>(self, f: F) -> Map<T>
fn map<F, T, Fut>(self, f: F) -> Map<T>
Applies
f
to each item of this stream in parallel, producing a new
stream with the results.Source§fn next(&mut self) -> NextFuture<'_, Self>
fn next(&mut self) -> NextFuture<'_, Self>
Applies
f
to each item of this stream in parallel, producing a new
stream with the results.Source§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
Creates a stream that yields its first
n
elements.impl<'__pin, S> Unpin for Take<S>where
PinnedFieldsOf<__Origin<'__pin, S>>: Unpin,
Auto Trait Implementations§
impl<S> Freeze for Take<S>where
S: Freeze,
impl<S> RefUnwindSafe for Take<S>where
S: RefUnwindSafe,
impl<S> Send for Take<S>where
S: Send,
impl<S> Sync for Take<S>where
S: Sync,
impl<S> UnwindSafe for Take<S>where
S: UnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<I> IntoParallelStream for Iwhere
I: ParallelStream,
impl<I> IntoParallelStream for Iwhere
I: ParallelStream,
Source§type Item = <I as ParallelStream>::Item
type Item = <I as ParallelStream>::Item
The type of the elements being iterated over.
Source§type IntoParStream = I
type IntoParStream = I
Which kind of stream are we turning this into?
Source§fn into_par_stream(self) -> I
fn into_par_stream(self) -> I
Creates a parallel stream from a value.