[][src]Module async_std::stream::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);
}

Structs

Chain

A stream that chains two streams one after another.

Cloned

A stream that clones the elements of an underlying stream.

Copied

A stream that copies the elements of an underlying stream.

Filter

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

FlatMap

A stream that maps each element to a stream, and yields the elements of the produced streams.

Flatten

A stream that flattens one level of nesting in an stream of things that can be turned into streams.

Fuse

A stream that yields None forever after the underlying stream yields None once.

Inspect

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

Map

A stream that maps value of another stream with a function.

Mergeunstable

A stream that merges two other streams into a single stream.

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.

TakeWhile

A stream that yields elements based on a predicate.

Timeout

A stream with timeout time set

TimeoutErrorunstable

An error returned when a stream times out.

Zip

A stream that takes items from two other streams simultaneously.

Traits

Stream

An asynchronous stream of values.

StreamExt

Extension methods for Stream.