Documentation crates.io Build Status

std and futures interoperability

This crate implements adapters for the two different future types: std::future::Future and futures::Future. You can should be able to seamlessly convert the one into the other. The aim if to be able to use new async/await syntax with existing futures::Future infrastructure.

Keep in mind that much of the used features are still unstable and only available on nightly with feature gates.

A simple example: ```

![feature(async_await)]

![feature(await_macro)]

![feature(futures_api)]

use std::time::{Duration, Instant}; use tokio::timer::Delay;

use backtothefuture::futuresawait; use backtothefuture::BoxIntoFutures; use backtothefuture::IntoFutures;

fn main() { let f = async { futuresawait!(Delay::new(Instant::now() + Duration::new(0, 10))).unwrap(); Ok(()) }; tokio::run(f.boxinto_futures()); } ```