Module futures::stream [] [src]

Asynchronous streams

This module contains the Stream trait and a number of adaptors for this trait. This trait is very similar to the Iterator trait in the standard library except that it expresses the concept of blocking as well. A stream here is a sequential sequence of values which may take some amount of time in between to produce.

A stream may request that it is blocked between values while the next value is calculated, and provides a way to get notified once the next value is ready as well.

Structs

AndThen

A stream combinator which chains a computation onto values produced by a stream.

BufferUnordered

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.

Collect

A future which collects all of the values of a stream into a vector.

Empty

A stream which contains no elements.

Filter

A stream combinator used to filter the results of a stream and only yield some values.

FilterMap

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.

Fuse

A stream which "fuse"s a stream once it's terminated.

FutureSender

A future returned by the Sender::send method which will resolve to the sender once it's available to send another message.

IterStream

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.

Merge

An adapter for merging the output of two streams.

OrElse

A stream combinator which chains a computation onto errors produced by a stream.

Peekable

A Stream that implements a peek method.

Receiver

The receiving end of a channel which implements the Stream trait.

Sender

The transmission end of a channel which is used to send values.

Skip

A stream combinator which skips a number of elements before continuing.

SkipWhile

A stream combinator which skips elements of a stream while a predicate holds.

StreamFuture

A combinator used to temporarily convert a stream into a future.

Take

A stream combinator which returns a maximum number of elements.

Then

A stream combinator which chains a computation onto each item produced by a stream.

Wait

A stream combinator which converts an asynchronous stream to a blocking iterator.

Zip

An adapter for merging the output of two streams.

Enums

MergedItem

An item returned from a merge stream, which represents an item from one or both of the underlying streams.

Traits

Stream

A stream of values, not all of which have been produced yet.

Functions

channel

Creates an in-memory channel implementation of the Stream trait.

empty

Creates a stream which contains no elements.

iter

Converts an Iterator into a Stream which is always ready to yield the next value.

Type Definitions

BoxStream

A type alias for Box<Stream + Send>