Function assignable

Source
pub fn assignable<'a, Fut: Future + Send + 'a>(
    future: Fut,
) -> Async<BoxFuture<'a, Fut::Output>> โ“˜
๐Ÿ‘ŽDeprecated since 1.1.0: Use assignable! or Async::assignable instead.
Expand description

Wraps the given Future with Async so that the result can be used with the Assign variants of std::ops traits.

Use assignable! and Async::assignable instead.

ยงExample

use futures_executor::block_on;

let a = async { 40 };
let b = async { 2 };

let result = async {
  let mut a = async_ops::assignable(a);
  a += b;
  a.await
};

assert_eq!(42, block_on(result));