fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
    where
        F: FnMut(Self::Item) -> Fut,
        Fut: Future,
        Self: Sized,
    {
        assert_stream::<Fut::Output, _>(Then::new(self, f))
    }
Computes from this stream's items new items of a different type using
an asynchronous closure.

The provided closure `f` will be called with an `Item` once a value is
ready, it returns a future which will then be run to completion
to produce the next value on this stream.

Note that this function consumes the stream passed into it and returns a
wrapped version of it.

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

# Examples

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

let stream = stream::iter(1..=3);
let stream = stream.then(|x| async move { x + 3 });

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