[][src]Module async_std::stream

Asynchronous iteration.

This module is an async version of std::iter.

Examples

use async_std::prelude::*;
use async_std::stream;

let mut s = stream::repeat(9).take(3);

while let Some(v) = s.next().await {
    assert_eq!(v, 9);
}

Macros

joinunstable

Combines multiple streams into a single stream of all their outputs.

Structs

Chain

Chains two streams one after another.

Empty

A stream that doesn't yield any items.

Filter

A stream to filter elements of another stream with a predicate.

Fuse

A Stream that is permanently closed once a single call to poll results in Poll::Ready(None), returning Poll::Ready(None) for all future calls to poll.

Inspect

A stream that does something with each element of another stream.

Joinunstable

A stream joining two or more streams.

Once

A stream that yields a single item.

Repeat

A stream that yields the same item repeatedly.

Scan

A stream to maintain state while polling another stream.

Skip

A stream to skip first n elements of another stream.

SkipWhile

A stream to skip elements of another stream based on a predicate.

StepBy

A stream that steps a given amount of elements of another stream.

Take

A stream that yields the first n items of another stream.

Zip

An iterator that iterates two other iterators simultaneously.

Traits

DoubleEndedStreamunstable

A stream able to yield elements from both ends.

Extendunstable

Extend a collection with the contents of a stream.

FromStreamunstable

Conversion from a Stream.

IntoStreamunstable

Conversion into a Stream.

Stream

An asynchronous stream of values.

Functions

empty

Creates a stream that doesn't yield any items.

once

Creates a stream that yields a single item.

repeat

Creates a stream that yields the same item repeatedly.