stream-future 0.5.0

Implement an async iterator with return value.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![feature(coroutines)]

use std::future::ready;
use stream_future::*;

#[tokio::test]
async fn nested() {
    #[stream]
    async fn foo() {
        yield;
        async { ready(1).await }.await;
        yield;
    }

    foo().await;
}