Module stream
Asynchronous streams.
This module contains:
- The
Streamtrait, for objects that can asynchronously produce a sequence of values. - The
StreamExtandTryStreamExttrait, which provides adapters for chaining and composing streams. - Top-level stream constructors like
iterwhich creates a stream from an iterator.
Modules
- futures_unordered An unbounded set of futures.
- select_all An unbounded set of streams
Structs
-
AbortHandle
A handle to an
Abortabletask. -
AbortRegistration
A registration handle for an
Abortabletask. Values of this type can be acquired fromAbortHandle::newand are used in calls toAbortable::new. -
Abortable
A future/stream which can be remotely short-circuited using an
AbortHandle. -
Aborted
Indicator that the
Abortabletask was aborted. -
All
Future for the
allmethod. -
AndThen
Stream for the
and_thenmethod. -
Any
Future for the
anymethod. -
BufferUnordered
Stream for the
buffer_unorderedmethod. -
Buffered
Stream for the
bufferedmethod. -
CatchUnwind
Stream for the
catch_unwindmethod. -
Chain
Stream for the
chainmethod. -
Chunks
Stream for the
chunksmethod. -
Collect
Future for the
collectmethod. -
Concat
Future for the
concatmethod. -
Count
Future for the
countmethod. -
Cycle
Stream for the
cyclemethod. -
Empty
Stream for the
emptyfunction. -
Enumerate
Stream for the
enumeratemethod. -
ErrInto
Stream for the
err_intomethod. -
Filter
Stream for the
filtermethod. -
FilterMap
Stream for the
filter_mapmethod. -
FlatMap
Stream for the
flat_mapmethod. -
FlatMapUnordered
Stream for the
flat_map_unorderedmethod. -
Flatten
Stream for the
flattenmethod. -
Fold
Future for the
foldmethod. -
ForEach
Future for the
for_eachmethod. -
ForEachConcurrent
Future for the
for_each_concurrentmethod. -
Forward
Future for the
forwardmethod. -
Fuse
Stream for the
fusemethod. - FuturesOrdered An unbounded queue of futures.
- FuturesUnordered A set of futures which may complete in any order.
-
Inspect
Stream for the
inspectmethod. -
InspectErr
Stream for the
inspect_errmethod. -
InspectOk
Stream for the
inspect_okmethod. -
IntoAsyncRead
Reader for the
into_async_readmethod. -
IntoStream
Stream for the
into_streammethod. -
Iter
Stream for the
iterfunction. -
Map
Stream for the
mapmethod. -
MapErr
Stream for the
map_errmethod. -
MapOk
Stream for the
map_okmethod. -
Next
Future for the
nextmethod. -
NextIf
Future for the
Peekable::next_ifmethod. -
NextIfEq
Future for the
Peekable::next_if_eqmethod. - Once A stream which emits single element and then EOF.
-
OrElse
Stream for the
or_elsemethod. -
Peek
Future for the
Peekable::peekmethod. -
PeekMut
Future for the
Peekable::peek_mutmethod. -
Peekable
A
Streamthat implements apeekmethod. -
Pending
Stream for the [
pending()] function. -
PollFn
Stream for the
poll_fnfunction. - PollImmediate Stream for the poll_immediate function.
-
ReadyChunks
Stream for the
ready_chunksmethod. -
Repeat
Stream for the
repeatfunction. -
RepeatWith
An stream that repeats elements of type
Aendlessly by applying the provided closureF: FnMut() -> A. -
ReuniteError
Error indicating a
SplitSink<S>andSplitStream<S>were not two halves of aStream + Split, and thus could not bereunited. -
Scan
Stream for the
scanmethod. -
Select
Stream for the [
select()] function. - SelectAll An unbounded set of streams
-
SelectNextSome
Future for the
select_next_somemethod. -
SelectWithStrategy
Stream for the [
select_with_strategy()] function. See function docs for details. -
Skip
Stream for the
skipmethod. -
SkipWhile
Stream for the
skip_whilemethod. -
SplitSink
A
Sinkpart of the split pair -
SplitStream
A
Streampart of the split pair -
StreamFuture
Future for the
into_futuremethod. -
Take
Stream for the
takemethod. -
TakeUntil
Stream for the
take_untilmethod. -
TakeWhile
Stream for the
take_whilemethod. -
Then
Stream for the
thenmethod. -
TryAll
Future for the
try_allmethod. -
TryAny
Future for the
try_anymethod. -
TryBufferUnordered
Stream for the
try_buffer_unorderedmethod. -
TryBuffered
Stream for the
try_bufferedmethod. -
TryChunks
Stream for the
try_chunksmethod. - TryChunksError Error indicating, that while chunk was collected inner stream produced an error.
-
TryCollect
Future for the
try_collectmethod. -
TryConcat
Future for the
try_concatmethod. -
TryFilter
Stream for the
try_filtermethod. -
TryFilterMap
Stream for the
try_filter_mapmethod. -
TryFlatten
Stream for the
try_flattenmethod. -
TryFlattenUnordered
Stream for the
try_flatten_unorderedmethod. -
TryFold
Future for the
try_foldmethod. -
TryForEach
Future for the
try_for_eachmethod. -
TryForEachConcurrent
Future for the
try_for_each_concurrentmethod. -
TryNext
Future for the
try_nextmethod. -
TryReadyChunks
Stream for the
try_ready_chunksmethod. - TryReadyChunksError Error indicating, that while chunk was collected inner stream produced an error.
-
TrySkipWhile
Stream for the
try_skip_whilemethod. -
TryTakeWhile
Stream for the
try_take_whilemethod. -
TryUnfold
Stream for the
try_unfoldfunction. -
Unfold
Stream for the
unfoldfunction. -
Unzip
Future for the
unzipmethod. -
Zip
Stream for the
zipmethod.
Enums
-
PollNext
Type to tell
SelectWithStrategywhich stream to poll next.
Traits
- FusedStream
- Stream
-
StreamExt
An extension trait for
Streams that provides a variety of convenient combinator functions. - TryStream
-
TryStreamExt
Adapters specific to
Result-returning streams
Functions
-
abortable
Creates a new
Abortablestream and anAbortHandlewhich can be used to stop it. - empty Creates a stream which contains no elements.
-
iter
Converts an
Iteratorinto aStreamwhich is always ready to yield the next value. - once Creates a stream of a single element.
- pending Creates a stream which never returns any elements.
-
poll_fn
Creates a new stream wrapping a function returning
Poll<Option<T>>. - poll_immediate Creates a new stream that always immediately returns Poll::Ready when awaiting it.
- repeat Create a stream which produces the same item repeatedly.
-
repeat_with
Creates a new stream that repeats elements of type
Aendlessly by applying the provided closure, the repeater,F: FnMut() -> A. - select This function will attempt to pull items from both streams. Each stream will be polled in a round-robin fashion, and whenever a stream is ready to yield an item that item is yielded.
-
select_all
Convert a list of streams into a
Streamof results from the streams. -
select_with_strategy
This function will attempt to pull items from both streams. You provide a
closure to tell
SelectWithStrategywhich stream to poll. The closure can store state onSelectWithStrategyto which it will receive a&muton every invocation. This allows basing the strategy on prior choices. -
try_unfold
Creates a
TryStreamfrom a seed and a closure returning aTryFuture. -
unfold
Creates a
Streamfrom a seed and a closure returning aFuture.
Type Aliases
- BoxStream
-
FlattenUnordered
Stream for the
flatten_unorderedmethod. - LocalBoxStream