fn take(self, n: usize) -> Take<Self>
    where
        Self: Sized,
    {
        assert_stream::<Self::Item, _>(Take::new(self, n))
    }
Creates a new stream of at most `n` items of the underlying stream.

Once `n` items have been yielded from this stream then it will always
return that the stream is done.

# Examples

```
# futures::executor::block_on(async {
use futures::stream::{self, StreamExt};

let stream = stream::iter(1..=10).take(3);

assert_eq!(vec![1, 2, 3], stream.collect::<Vec<_>>().await);
# });
```
futures-util/src/stream/stream/mod.rs