futures_future

Crates.iofutures_future
lib.rsfutures_future
version0.1.1
sourcesrc
created_at2018-09-11 12:29:02.86037
updated_at2018-09-28 12:07:46.195329
descriptionThe Rust crate that converts the old style futures crate `futures::Future` into the new nightly async/await style `std::future::Future` so you can easily try out the new syntax.
homepagehttps://github.com/tinco/futures_future
repositoryhttps://github.com/tinco/futures_future
max_upload_size
id84101
size3,682
Tinco Andringa (tinco)

documentation

https://docs.rs/tinco/futures_future

README

WARNING: DOES NOT ACTUALLY WORK I THINK

This requires some kind of task system, which I can't figure out. It might sporadically work, but not consistently because there's no implementation for waking up tasks.

Futures Future

The Rust crate that converts the old style futures crate futures::Future into the new nightly async/await style std::future::Future so you can easily try out the new syntax.

Example

#![feature(async_await)]
#![feature(futures_api)]
#![feature(await_macro)]

use futures::*;
use futures::sync::oneshot;
use futures_future::*;

pub async fn and_its_done() {
    let (signal_setup_done, mut setup_done) = oneshot::channel::<bool>();
    let _ = signal_setup_done.send(true);
    let f = futures_future(&mut setup_done);
    await!(f);
}

Commit count: 6

cargo fmt