Expand description
Asynchronous streams.
This module contains:
-
The
Stream
trait, for objects that can asynchronously produce a sequence of values. -
The
StreamExt
trait, which provides adapters for chaining and composing streams. -
Top-level stream contructors like
iter_ok
which creates a stream from an iterator, andfutures_unordered
, which constructs a stream from a collection of futures.
Structs§
- AndThen
- A stream combinator which chains a computation onto values produced by a stream.
- Buffer
Unordered - An adaptor for a stream of futures to execute the futures concurrently, if possible, delivering results as they become available.
- Buffered
- An adaptor for a stream of futures to execute the futures concurrently, if possible.
- Catch
Unwind - Stream for the
catch_unwind
combinator. - Chain
- An adapter for chaining the output of two streams.
- Chunks
- An adaptor that chunks up elements in a vector.
- Collect
- A future which collects all of the values of a stream into a vector.
- Concat
- A stream combinator to concatenate the results of a stream into the first yielded item.
- Empty
- A stream which contains no elements.
- ErrInto
- A stream combinator to change the error type of a stream.
- Filter
- A stream combinator used to filter the results of a stream and only yield some values.
- Filter
Map - A combinator used to filter the results of a stream and simultaneously map them to a different type.
- Flatten
- A combinator used to flatten a stream-of-streams into one long stream of elements.
- Fold
- A future used to collect all the results of a stream into one generic type.
- ForEach
- A stream combinator which executes a unit closure over each item on a stream.
- Forward
- Future for the
Stream::forward
combinator, which sends a stream of values to a sink and then waits until the sink has fully flushed those values. - Fuse
- A stream which “fuse“s a stream once it’s terminated.
- Futures
Ordered - An unbounded queue of futures.
- Futures
Unordered - A set of
Future
s which may complete in any order. - Inspect
- Do something with the items of a stream, passing it on.
- Inspect
Err - Do something with the error of a stream, passing it on.
- IterOk
- A stream which is just a shim over an underlying instance of
Iterator
. - Iter
Result - A stream which is just a shim over an underlying instance of
Iterator
. - Map
- A stream combinator which will change the type of a stream from one type to another.
- MapErr
- A stream combinator which will change the error type of a stream from one type to another.
- Once
- A stream which emits single element and then EOF.
- OrElse
- A stream combinator which chains a computation onto errors produced by a stream.
- Peekable
- A
Stream
that implements apeek
method. - PollFn
- A stream which adapts a function returning
Poll
. - Repeat
- Stream that produces the same element repeatedly.
- Reunite
Error - Error indicating a
SplitSink<S>
andSplitStream<S>
were not two halves of aStream + Split
, and thus could not bereunite
d. - Select
- An adapter for merging the output of two streams.
- Select
All - An unbounded set of streams
- Skip
- A stream combinator which skips a number of elements before continuing.
- Skip
While - A stream combinator which skips elements of a stream while a predicate holds.
- Split
Sink - A
Sink
part of the split pair - Split
Stream - A
Stream
part of the split pair - Stream
Future - A combinator used to temporarily convert a stream into a future.
- Take
- A stream combinator which returns a maximum number of elements.
- Take
While - A stream combinator which takes elements from a stream while a predicate holds.
- Then
- A stream combinator which chains a computation onto each item produced by a stream.
- Unfold
- A stream which creates futures, polls them and return their result
- Zip
- An adapter for merging the output of two streams.
Traits§
- Stream
- A stream of values produced asynchronously.
- Stream
Ext - An extension trait for
Stream
s that provides a variety of convenient combinator functions.
Functions§
- empty
- Creates a stream which contains no elements.
- futures_
ordered - Converts a list of futures into a
Stream
of results from the futures. - futures_
unordered - Converts a list of futures into a
Stream
of results from the futures. - iter_ok
- Converts an
Iterator
into aStream
which is always ready to yield the next value. - iter_
result - Converts an
Iterator
overResult
s into aStream
which is always ready to yield the next value. - once
- Creates a stream of single element
- poll_fn
- Creates a new stream wrapping around a function returning
Poll
. - repeat
- Create a stream which produces the same item repeatedly.
- select_
all - Convert a list of streams into a
Stream
of results from the streams. - unfold
- Creates a
Stream
from a seed and a closure returning aFuture
.