Streams

The Stream Trait

The Stream trait is basically the love-child of Future and Iterator:


#![allow(unused)]
fn main() {
trait Stream {
  // Yielded type
  type Item;

  // Attempt to resolve the next item in the stream.
  fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>)
    -> Poll<Option<Self::Item>>;
}
}

Iteration and Concurrency