Created
July 12, 2019 12:58
-
-
Save fenhl/0e56173045c23a7b471119a12e348312 to your computer and use it in GitHub Desktop.
tokio::main problem minimal example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "tokio-main" | |
version = "0.1.0" | |
authors = ["Fenhl <[email protected]>"] | |
edition = "2018" | |
[[bin]] | |
name = "tokio-main" | |
path = "src/main.rs" | |
[dependencies.futures-preview] | |
version = "0.3.0-alpha.16" | |
[dependencies.tokio] | |
git = "https://github.com/tokio-rs/tokio" | |
rev = "22918231814fb5591a4c0c6d5aa0c5ba8172c9c1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(async_await)] | |
use { | |
std::pin::Pin, | |
futures::prelude::* | |
}; | |
fn stream() -> Pin<Box<dyn Stream<Item = ()>>> { | |
stream::repeat(()).boxed() | |
} | |
#[tokio::main] | |
async fn main() { | |
let mut stream = stream(); | |
stream.next().await; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment