Macro assignable

Source
macro_rules! assignable {
    ($var:ident) => { ... };
}
Expand description

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

See also Async::assignable.

ยงExample

use futures_executor::block_on;

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

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

assert_eq!(42, block_on(result));