This is a compatibility shim between [futures][] v0.1 and v0.2. It provides implementations that allow a type that implements Future
from v0.1 to act as a Future
from v0.2, and vice-versa.
Note: Task-local data doesn't really work, and getting it to work would require horrid unsafe hackery. It could probably be done if there was enough demand.
```rust extern crate futurescompat; use futurescompat::futures_01::FutureInto02;
let futv01 = somelibthathasntupgraded();
let futv02 = futv01.into02compat() .map(|val| { println!("map from v0.2! {:?}", val); Ok(()) });
// spawn in a futures 0.2 executor ```
```rust extern crate futurescompat; use futurescompat::futures_01::FutureInto01;
let futv02 = somelibusingthenewhotness(); let exec = getmycurrentexecutor();
let futv01 = futv02.into01compat(exec) .map(|val| { println!("map from v0.1! {:?}", val); Ok(()) });
// spawn in a futures 0.1 executor futv01.wait().unwrap(); ```