fn map<T, F>(self, f: F) -> Map<Self, F>
    where
        F: FnMut(Self::Item) -> T,
        Self: Sized,
    {
        assert_stream::<T, _>(Map::new(self, f))
    }
Maps this stream's items to a different type, returning a new stream of
the resulting type.

The provided closure is executed over all elements of this stream as
they are made available. It is executed inline with calls to
[`poll_next`](Stream::poll_next).

Note that this function consumes the stream passed into it and returns a
wrapped version of it, similar to the existing `map` methods in the
standard library.

See [`StreamExt::then`](Self::then) if you want to use a closure that
returns a future instead of a value.

# Examples

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

let stream = stream::iter(1..=3);
let stream = stream.map(|x| x + 3);

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