[−][src]Module async_std::stream
Composable 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 | 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. |
FromFn | A stream that yields elements by calling a closure. |
Fuse | A |
Inspect | A stream that does something with each element of another stream. |
Interval | unstable A stream representing notifications at fixed interval |
Merge | unstable A stream that merges two other streams into a single stream. |
Once | A stream that yields a single item. |
Repeat | A stream that yields the same item repeatedly. |
RepeatWith | A stream that repeats elements of type |
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 |
TakeWhile | A stream that yields elements based on a predicate. |
Zip | An iterator that iterates two other iterators simultaneously. |
Traits
DoubleEndedStream | unstable A stream able to yield elements from both ends. |
ExactSizeStream | unstable A stream that knows its exact length. |
Extend | unstable Extend a collection with the contents of a stream. |
FromStream | unstable Conversion from a |
FusedStream | unstable A stream that always continues to yield |
IntoStream | unstable Conversion into a |
Product | unstable Trait to represent types that can be created by productming up a stream. |
Stream | An asynchronous stream of values. |
Sum | unstable Trait to represent types that can be created by summing up a stream. |
Functions
empty | Creates a stream that doesn't yield any items. |
from_fn | Creates a new stream where to produce each new element a provided closure is called. |
interval | unstable Creates a new stream that yields at a set interval. |
once | Creates a stream that yields a single item. |
repeat | Creates a stream that yields the same item repeatedly. |
repeat_with | Creates a new stream that repeats elements of type |