Trait StreamExt
trait StreamExt: Stream
An extension trait for Streams that provides a variety of convenient
combinator functions.
Provided Methods
fn next(self: &mut Self) -> Next<'_, Self> where Self: UnpinCreates a future that resolves to the next item in the stream.
Note that because
nextdoesn't take ownership over the stream, theStreamtype must beUnpin. If you want to usenextwith a!Unpinstream, you'll first have to pin the stream. This can be done by boxing the stream usingBox::pinor pinning it to the stack using thepin_mut!macro from thepin_utilscrate.Examples
# block_on;fn into_future(self: Self) -> StreamFuture<Self> where Self: Sized + UnpinConverts this stream into a future of
(next_item, tail_of_stream). If the stream terminates, then the next item isNone.The returned future can be used to compose streams and futures together by placing everything into the "world of futures".
Note that because
into_futuremoves the stream, theStreamtype must beUnpin. If you want to useinto_futurewith a!Unpinstream, you'll first have to pin the stream. This can be done by boxing the stream usingBox::pinor pinning it to the stack using thepin_mut!macro from thepin_utilscrate.Examples
# block_on;fn map<T, F>(self: Self, f: F) -> Map<Self, F> where F: FnMut(<Self as >::Item) -> T, Self: SizedMaps this stream's items to a different type, returning a new stream of the resulting type.
The provided closure is executed over all elements of this stream as they are made available. It is executed inline with calls to
poll_next.Note that this function consumes the stream passed into it and returns a wrapped version of it, similar to the existing
mapmethods in the standard library.See
StreamExt::thenif you want to use a closure that returns a future instead of a value.Examples
# block_on;fn enumerate(self: Self) -> Enumerate<Self> where Self: SizedCreates a stream which gives the current iteration count as well as the next value.
The stream returned yields pairs
(i, val), whereiis the current index of iteration andvalis the value returned by the stream.enumerate()keeps its count as ausize. If you want to count by a different sized integer, thezipfunction provides similar functionality.Overflow Behavior
The method does no guarding against overflows, so enumerating more than
usize::MAXelements either produces the wrong result or panics. If debug assertions are enabled, a panic is guaranteed.Panics
The returned stream might panic if the to-be-returned index would overflow a
usize.Examples
# block_on;fn filter<Fut, F>(self: Self, f: F) -> Filter<Self, Fut, F> where F: FnMut(&<Self as >::Item) -> Fut, Fut: Future<Output = bool>, Self: SizedFilters the values produced by this stream according to the provided asynchronous predicate.
As values of this stream are made available, the provided predicate
fwill be run against them. If the predicate returns aFuturewhich resolves totrue, then the stream will yield the value, but if the predicate returns aFuturewhich resolves tofalse, then the value will be discarded and the next value will be produced.Note that this function consumes the stream passed into it and returns a wrapped version of it, similar to the existing
filtermethods in the standard library.Examples
# block_on;fn filter_map<Fut, T, F>(self: Self, f: F) -> FilterMap<Self, Fut, F> where F: FnMut(<Self as >::Item) -> Fut, Fut: Future<Output = Option<T>>, Self: SizedFilters the values produced by this stream while simultaneously mapping them to a different type according to the provided asynchronous closure.
As values of this stream are made available, the provided function will be run on them. If the future returned by the predicate
fresolves toSome(item)then the stream will yield the valueitem, but if it resolves toNonethen the next value will be produced.Note that this function consumes the stream passed into it and returns a wrapped version of it, similar to the existing
filter_mapmethods in the standard library.Examples
# block_on;fn then<Fut, F>(self: Self, f: F) -> Then<Self, Fut, F> where F: FnMut(<Self as >::Item) -> Fut, Fut: Future, Self: SizedComputes from this stream's items new items of a different type using an asynchronous closure.
The provided closure
fwill be called with anItemonce a value is ready, it returns a future which will then be run to completion to produce the next value on this stream.Note that this function consumes the stream passed into it and returns a wrapped version of it.
See
StreamExt::mapif you want to use a closure that returns a value instead of a future.Examples
# block_on;fn collect<C: Default + Extend<<Self as >::Item>>(self: Self) -> Collect<Self, C> where Self: SizedTransforms a stream into a collection, returning a future representing the result of that computation.
The returned future will be resolved when the stream terminates.
Examples
# block_on;fn unzip<A, B, FromA, FromB>(self: Self) -> Unzip<Self, FromA, FromB> where FromA: Default + Extend<A>, FromB: Default + Extend<B>, Self: Sized + Stream<Item = (A, B)>Converts a stream of pairs into a future, which resolves to pair of containers.
unzip()produces a future, which resolves to two collections: one from the left elements of the pairs, and one from the right elements.The returned future will be resolved when the stream terminates.
Examples
# block_on;fn concat(self: Self) -> Concat<Self> where Self: Sized, <Self as >::Item: Extend<<<Self as Stream>::Item as IntoIterator>::Item> + IntoIterator + DefaultConcatenate all items of a stream into a single extendable destination, returning a future representing the end result.
This combinator will extend the first item with the contents of all the subsequent results of the stream. If the stream is empty, the default value will be returned.
Works with all collections that implement the
Extendtrait.Examples
# block_on;fn count(self: Self) -> Count<Self> where Self: SizedDrives the stream to completion, counting the number of items.
Overflow Behavior
The method does no guarding against overflows, so counting elements of a stream with more than
usize::MAXelements either produces the wrong result or panics. If debug assertions are enabled, a panic is guaranteed.Panics
This function might panic if the iterator has more than
usize::MAXelements.Examples
# block_on;fn cycle(self: Self) -> Cycle<Self> where Self: Sized + CloneRepeats a stream endlessly.
The stream never terminates. Note that you likely want to avoid usage of
collector such on the returned stream as it will exhaust available memory as it tries to just fill up all RAM.Examples
# block_on;fn fold<T, Fut, F>(self: Self, init: T, f: F) -> Fold<Self, Fut, T, F> where F: FnMut(T, <Self as >::Item) -> Fut, Fut: Future<Output = T>, Self: SizedExecute an accumulating asynchronous computation over a stream, collecting all the values into one final result.
This combinator will accumulate all values returned by this stream according to the closure provided. The initial state is also provided to this method and then is returned again by each execution of the closure. Once the entire stream has been exhausted the returned future will resolve to this value.
Examples
# block_on;fn any<Fut, F>(self: Self, f: F) -> Any<Self, Fut, F> where F: FnMut(<Self as >::Item) -> Fut, Fut: Future<Output = bool>, Self: SizedExecute predicate over asynchronous stream, and return
trueif any element in stream satisfied a predicate.Examples
# block_on;fn all<Fut, F>(self: Self, f: F) -> All<Self, Fut, F> where F: FnMut(<Self as >::Item) -> Fut, Fut: Future<Output = bool>, Self: SizedExecute predicate over asynchronous stream, and return
trueif all element in stream satisfied a predicate.Examples
# block_on;fn flatten(self: Self) -> Flatten<Self> where <Self as >::Item: Stream, Self: SizedFlattens a stream of streams into just one continuous stream.
Examples
# block_on;fn flatten_unordered<impl Into<Option<usize>>: Into<Option<usize>>>(self: Self, limit: impl Into<Option<usize>>) -> FlattenUnordered<Self> where <Self as >::Item: Stream + Unpin, Self: SizedFlattens a stream of streams into just one continuous stream. Polls inner streams produced by the base stream concurrently.
The only argument is an optional limit on the number of concurrently polled streams. If this limit is not
None, no more thanlimitstreams will be polled at the same time. Thelimitargument is of typeInto<Option<usize>>, and so can be provided as eitherNone,Some(10), or just10. Note: a limit of zero is interpreted as no limit at all, and will have the same result as passing inNone.Examples
# block_on;fn flat_map<U, F>(self: Self, f: F) -> FlatMap<Self, U, F> where F: FnMut(<Self as >::Item) -> U, U: Stream, Self: SizedMaps a stream like
StreamExt::mapbut flattens nestedStreams.StreamExt::mapis very useful, but if it produces aStreaminstead, you would have to chain combinators like.map(f).flatten()while this combinator provides ability to write.flat_map(f)instead of chaining.The provided closure which produces inner streams is executed over all elements of stream as last inner stream is terminated and next stream item is available.
Note that this function consumes the stream passed into it and returns a wrapped version of it, similar to the existing
flat_mapmethods in the standard library.Examples
# block_on;fn flat_map_unordered<U, F, impl Into<Option<usize>>: Into<Option<usize>>>(self: Self, limit: impl Into<Option<usize>>, f: F) -> FlatMapUnordered<Self, U, F> where U: Stream + Unpin, F: FnMut(<Self as >::Item) -> U, Self: SizedMaps a stream like
StreamExt::mapbut flattens nestedStreams and polls them concurrently, yielding items in any order, as they made available.StreamExt::mapis very useful, but if it producesStreams instead, and you need to poll all of them concurrently, you would have to use something likefor_each_concurrentand merge values by hand. This combinator provides ability to collect all values from concurrently polled streams into one stream.The first argument is an optional limit on the number of concurrently polled streams. If this limit is not
None, no more thanlimitstreams will be polled at the same time. Thelimitargument is of typeInto<Option<usize>>, and so can be provided as eitherNone,Some(10), or just10. Note: a limit of zero is interpreted as no limit at all, and will have the same result as passing inNone.The provided closure which produces inner streams is executed over all elements of stream as next stream item is available and limit of concurrently processed streams isn't exceeded.
Note that this function consumes the stream passed into it and returns a wrapped version of it.
Examples
# block_on;fn scan<S, B, Fut, F>(self: Self, initial_state: S, f: F) -> Scan<Self, S, Fut, F> where F: FnMut(&mut S, <Self as >::Item) -> Fut, Fut: Future<Output = Option<B>>, Self: SizedCombinator similar to
StreamExt::foldthat holds internal state and produces a new stream.Accepts initial state and closure which will be applied to each element of the stream until provided closure returns
None. OnceNoneis returned, stream will be terminated.Examples
# block_on;fn skip_while<Fut, F>(self: Self, f: F) -> SkipWhile<Self, Fut, F> where F: FnMut(&<Self as >::Item) -> Fut, Fut: Future<Output = bool>, Self: SizedSkip elements on this stream while the provided asynchronous predicate resolves to
true.This function, like
Iterator::skip_while, will skip elements on the stream until the predicatefresolves tofalse. Once one element returnsfalse, all future elements will be returned from the underlying stream.Examples
# block_on;fn take_while<Fut, F>(self: Self, f: F) -> TakeWhile<Self, Fut, F> where F: FnMut(&<Self as >::Item) -> Fut, Fut: Future<Output = bool>, Self: SizedTake elements from this stream while the provided asynchronous predicate resolves to
true.This function, like
Iterator::take_while, will take elements from the stream until the predicatefresolves tofalse. Once one element returnsfalse, it will always return that the stream is done.Examples
# block_on;fn take_until<Fut>(self: Self, fut: Fut) -> TakeUntil<Self, Fut> where Fut: Future, Self: SizedTake elements from this stream until the provided future resolves.
This function will take elements from the stream until the provided stopping future
futresolves. Once thefutfuture becomes ready, this stream combinator will always return that the stream is done.The stopping future may return any type. Once the stream is stopped the result of the stopping future may be accessed with
TakeUntil::take_result(). The stream may also be resumed withTakeUntil::take_future(). See the documentation ofTakeUntilfor more information.Examples
# block_on;fn for_each<Fut, F>(self: Self, f: F) -> ForEach<Self, Fut, F> where F: FnMut(<Self as >::Item) -> Fut, Fut: Future<Output = ()>, Self: SizedRuns this stream to completion, executing the provided asynchronous closure for each element on the stream.
The closure provided will be called for each item this stream produces, yielding a future. That future will then be executed to completion before moving on to the next item.
The returned value is a
Futurewhere theOutputtype is(); it is executed entirely for its side effects.To process each item in the stream and produce another stream instead of a single future, use
theninstead.Examples
# block_on;fn for_each_concurrent<Fut, F, impl Into<Option<usize>>: Into<Option<usize>>>(self: Self, limit: impl Into<Option<usize>>, f: F) -> ForEachConcurrent<Self, Fut, F> where F: FnMut(<Self as >::Item) -> Fut, Fut: Future<Output = ()>, Self: SizedRuns this stream to completion, executing the provided asynchronous closure for each element on the stream concurrently as elements become available.
This is similar to
StreamExt::for_each, but the futures produced by the closure are run concurrently (but not in parallel-- this combinator does not introduce any threads).The closure provided will be called for each item this stream produces, yielding a future. That future will then be executed to completion concurrently with the other futures produced by the closure.
The first argument is an optional limit on the number of concurrent futures. If this limit is not
None, no more thanlimitfutures will be run concurrently. Thelimitargument is of typeInto<Option<usize>>, and so can be provided as eitherNone,Some(10), or just10. Note: a limit of zero is interpreted as no limit at all, and will have the same result as passing inNone.This method is only available when the
stdorallocfeature of this library is activated, and it is activated by default.Examples
# block_onfn take(self: Self, n: usize) -> Take<Self> where Self: SizedCreates a new stream of at most
nitems of the underlying stream.Once
nitems have been yielded from this stream then it will always return that the stream is done.Examples
# block_on;fn skip(self: Self, n: usize) -> Skip<Self> where Self: SizedCreates a new stream which skips
nitems of the underlying stream.Once
nitems have been skipped from this stream then it will always return the remaining items on this stream.Examples
# block_on;fn fuse(self: Self) -> Fuse<Self> where Self: SizedFuse a stream such that
poll_nextwill never again be called once it has finished. This method can be used to turn anyStreaminto aFusedStream.Normally, once a stream has returned
Nonefrompoll_nextany further calls could exhibit bad behavior such as block forever, panic, never return, etc. If it is known thatpoll_nextmay be called after stream has already finished, then this method can be used to ensure that it has defined semantics.The
poll_nextmethod of afused stream is guaranteed to returnNoneafter the underlying stream has finished.Examples
use block_on_stream; use ; use Poll; let mut x = 0; let stream = poll_fn.fuse; let mut iter = block_on_stream; assert_eq!; assert_eq!; assert_eq!; assert_eq!; // ...fn by_ref(self: &mut Self) -> &mut SelfBorrows a stream, rather than consuming it.
This is useful to allow applying stream adaptors while still retaining ownership of the original stream.
Examples
# block_on;fn catch_unwind(self: Self) -> CatchUnwind<Self> where Self: Sized + UnwindSafeCatches unwinding panics while polling the stream.
Caught panic (if any) will be the last element of the resulting stream.
In general, panics within a stream can propagate all the way out to the task level. This combinator makes it possible to halt unwinding within the stream itself. It's most commonly used within task executors. This method should not be used for error handling.
Note that this method requires the
UnwindSafebound from the standard library. This isn't always applied automatically, and the standard library provides anAssertUnwindSafewrapper type to apply it after-the fact. To assist using this method, theStreamtrait is also implemented forAssertUnwindSafe<St>whereStimplementsStream.This method is only available when the
stdfeature of this library is activated, and it is activated by default.Examples
# block_on;fn boxed<'a>(self: Self) -> BoxStream<'a, <Self as >::Item> where Self: Sized + Send + 'aWrap the stream in a Box, pinning it.
This method is only available when the
stdorallocfeature of this library is activated, and it is activated by default.fn boxed_local<'a>(self: Self) -> LocalBoxStream<'a, <Self as >::Item> where Self: Sized + 'aWrap the stream in a Box, pinning it.
Similar to
boxed, but without theSendrequirement.This method is only available when the
stdorallocfeature of this library is activated, and it is activated by default.fn buffered(self: Self, n: usize) -> Buffered<Self> where <Self as >::Item: Future, Self: SizedAn adaptor for creating a buffered list of pending futures.
If this stream's item can be converted into a future, then this adaptor will buffer up to at most
nfutures and then return the outputs in the same order as the underlying stream. No more thannfutures will be buffered at any point in time, and less thannmay also be buffered depending on the state of each future.The returned stream will be a stream of each future's output.
This method is only available when the
stdorallocfeature of this library is activated, and it is activated by default.fn buffer_unordered(self: Self, n: usize) -> BufferUnordered<Self> where <Self as >::Item: Future, Self: SizedAn adaptor for creating a buffered list of pending futures (unordered).
If this stream's item can be converted into a future, then this adaptor will buffer up to
nfutures and then return the outputs in the order in which they complete. No more thannfutures will be buffered at any point in time, and less thannmay also be buffered depending on the state of each future.The returned stream will be a stream of each future's output.
This method is only available when the
stdorallocfeature of this library is activated, and it is activated by default.Examples
# block_on.unwrap;fn zip<St>(self: Self, other: St) -> Zip<Self, St> where St: Stream, Self: SizedAn adapter for zipping two streams together.
The zipped stream waits for both streams to produce an item, and then returns that pair. If either stream ends then the zipped stream will also end.
Examples
# block_on;fn chain<St>(self: Self, other: St) -> Chain<Self, St> where St: Stream<Item = <Self as >::Item>, Self: SizedAdapter for chaining two streams.
The resulting stream emits elements from the first stream, and when first stream reaches the end, emits the elements from the second stream.
# block_on;fn peekable(self: Self) -> Peekable<Self> where Self: SizedCreates a new stream which exposes a
peekmethod.Calling
peekreturns a reference to the next item in the stream.fn chunks(self: Self, capacity: usize) -> Chunks<Self> where Self: SizedAn adaptor for chunking up items of the stream inside a vector.
This combinator will attempt to pull items from this stream and buffer them into a local vector. At most
capacityitems will get buffered before they're yielded from the returned stream.Note that the vectors returned from this iterator may not always have
capacityelements. If the underlying stream ended and only a partial vector was created, it'll be returned. Additionally if an error happens from the underlying stream then the currently buffered items will be yielded.This method is only available when the
stdorallocfeature of this library is activated, and it is activated by default.Panics
This method will panic if
capacityis zero.fn ready_chunks(self: Self, capacity: usize) -> ReadyChunks<Self> where Self: SizedAn adaptor for chunking up ready items of the stream inside a vector.
This combinator will attempt to pull ready items from this stream and buffer them into a local vector. At most
capacityitems will get buffered before they're yielded from the returned stream. If underlying stream returnsPoll::Pending, and collected chunk is not empty, it will be immediately returned.If the underlying stream ended and only a partial vector was created, it will be returned.
This method is only available when the
stdorallocfeature of this library is activated, and it is activated by default.Panics
This method will panic if
capacityis zero.fn forward<S>(self: Self, sink: S) -> Forward<Self, S> where S: Sink<<Self as >::Ok, Error = <Self as >::Error>, Self: TryStream + SizedA future that completes after the given stream has been fully processed into the sink and the sink has been flushed and closed.
This future will drive the stream to keep producing items until it is exhausted, sending each item to the sink. It will complete once the stream is exhausted, the sink has received and flushed all items, and the sink is closed. Note that neither the original stream nor provided sink will be output by this future. Pass the sink by
Pin<&mut S>(for example, viaforward(&mut sink)inside anasyncfn/block) in order to preserve access to theSink. If the stream produces an error, that error will be returned by this future without flushing/closing the sink.fn split<Item>(self: Self) -> (SplitSink<Self, Item>, SplitStream<Self>) where Self: Sink<Item> + SizedSplits this
Stream + Sinkobject into separateSinkandStreamobjects.This can be useful when you want to split ownership between tasks, or allow direct interaction between the two objects (e.g. via
Sink::send_all).This method is only available when the
stdorallocfeature of this library is activated, and it is activated by default.fn inspect<F>(self: Self, f: F) -> Inspect<Self, F> where F: FnMut(&<Self as >::Item), Self: SizedDo something with each item of this stream, afterwards passing it on.
This is similar to the
Iterator::inspectmethod in the standard library where it allows easily inspecting each value as it passes through the stream, for example to debug what's going on.fn left_stream<B>(self: Self) -> Either<Self, B> where B: Stream<Item = <Self as >::Item>, Self: SizedWrap this stream in an
Eitherstream, making it the left-hand variant of thatEither.This can be used in combination with the
right_streammethod to writeifstatements that evaluate to different streams in different branches.fn right_stream<B>(self: Self) -> Either<B, Self> where B: Stream<Item = <Self as >::Item>, Self: SizedWrap this stream in an
Eitherstream, making it the right-hand variant of thatEither.This can be used in combination with the
left_streammethod to writeifstatements that evaluate to different streams in different branches.fn poll_next_unpin(self: &mut Self, cx: &mut Context<'_>) -> Poll<Option<<Self as >::Item>> where Self: UnpinA convenience method for calling
Stream::poll_nextonUnpinstream types.fn select_next_some(self: &mut Self) -> SelectNextSome<'_, Self> where Self: Unpin + FusedStreamReturns a
Futurethat resolves when the next item in this stream is ready.This is similar to the [
next][StreamExt::next] method, but it won't resolve toNoneif used on an emptyStream. Instead, the returned future type will returntruefromFusedFuture::is_terminatedwhen theStreamis empty, allowing [select_next_some][StreamExt::select_next_some] to be easily used with theselect!macro.If the future is polled after this
Streamis empty it will panic. Using the future with aFusedFuture-aware primitive like theselect!macro will prevent this.Examples
# block_on;
Implementors
impl<T> StreamExt for Zip<St1, St2>impl<T> StreamExt for Unfold<T, F, Fut>impl<T> StreamExt for Iter<I>impl<T> StreamExt for TryTakeWhile<St, Fut, F>impl<T> StreamExt for TryChunks<St>impl<T> StreamExt for FlattenSink<Fut, Si>impl<T> StreamExt for FlatMapUnordered<St, U, F>impl<T> StreamExt for SplitStream<S>impl<T> StreamExt for Filter<St, Fut, F>impl<T> StreamExt for PollImmediate<T>impl<T> StreamExt for Peekable<St>impl<T> StreamExt for Chunks<St>impl<T> StreamExt for TakeWhile<St, Fut, F>impl<T> StreamExt for ErrInto<St, E>impl<T> StreamExt for TakeUntil<St, Fut>impl<T> StreamExt for FuturesUnordered<Fut>impl<T> StreamExt for TrySkipWhile<St, Fut, F>impl<T> StreamExt for FlatMap<St, U, F>impl<T> StreamExt for TryFilter<St, Fut, F>impl<T> StreamExt for Lines<R>impl<T> StreamExt for Empty<T>impl<T> StreamExt for CatchUnwind<St>impl<T> StreamExt for RepeatWith<F>impl<T> StreamExt for Scan<St, S, Fut, F>impl<T> StreamExt for Fuse<St>impl<T> StreamExt for TryFlattenStream<Fut>impl<T> StreamExt for InspectErr<St, F>impl<T> StreamExt for Repeat<T>impl<T> StreamExt for OrElse<St, Fut, F>impl<T> StreamExt for Take<St>impl<T> StreamExt for SkipWhile<St, Fut, F>impl<T> StreamExt for AndThen<St, Fut, F>impl<T> StreamExt for PollImmediate<S>impl<T> StreamExt for TryBuffered<St>impl<T> StreamExt for Buffer<Si, Item>impl<T> StreamExt for TryUnfold<T, F, Fut>impl<T> StreamExt for Chain<St1, St2>impl<T> StreamExt for Buffered<St>impl<T> StreamExt for Timpl<T> StreamExt for IntoStream<F>impl<T> StreamExt for Enumerate<St>impl<T> StreamExt for InspectOk<St, F>impl<T> StreamExt for Skip<St>impl<T> StreamExt for FuturesOrdered<T>impl<T> StreamExt for FlattenStream<F>impl<T> StreamExt for Once<Fut>impl<T> StreamExt for TryFlattenUnordered<St>impl<T> StreamExt for TryReadyChunks<St>impl<T> StreamExt for TryBufferUnordered<St>impl<T> StreamExt for Abortable<T>impl<T> StreamExt for Map<St, F>impl<T> StreamExt for PollFn<F>impl<T> StreamExt for FilterMap<St, Fut, F>impl<T> StreamExt for SelectAll<St>impl<T> StreamExt for Pending<T>impl<T> StreamExt for MapOk<St, F>impl<T> StreamExt for Select<St1, St2>impl<T> StreamExt for Cycle<St>impl<T> StreamExt for IntoStream<St>impl<T> StreamExt for Then<St, Fut, F>impl<T> StreamExt for TryFlatten<St>impl<T> StreamExt for TryFilterMap<St, Fut, F>impl<T> StreamExt for Inspect<St, F>impl<T> StreamExt for With<Si, Item, U, Fut, F>impl<T> StreamExt for SinkMapErr<Si, F>impl<T> StreamExt for SinkErrInto<Si, Item, E>impl<T> StreamExt for WithFlatMap<Si, Item, U, St, F>impl<T> StreamExt for SelectWithStrategy<St1, St2, Clos, State>impl<T> StreamExt for Flatten<St>impl<T> StreamExt for Either<A, B>impl<T> StreamExt for BufferUnordered<St>impl<T> StreamExt for MapErr<St, F>impl<T> StreamExt for ReadyChunks<St>