summaryrefslogtreecommitdiff
path: root/src/main.rs
blob: e1e8efd11f2c353566086acc83c1899d7bcdb354 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use futures::executor::block_on;
use rand::prelude::*;

trait SimpleFuture {
    type Output;
    fn poll(&mut self, wake: fn()) -> Poll<Self::Output>;
}

enum Poll<T> {
    Ready(T),
    Pending,
}

async fn hello_world() {
    let mut rng = rand::thread_rng();
    let y: f64 = rng.gen();
    println!("hello, world! {}", y);
}

fn main() {
    let future = hello_world();
    block_on(future);
}