std
and futures
interoperabilityThis 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: ```rust
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()); } ```