Function on

Source
pub fn on<Fut: Future>(future: Fut) -> Async<Fut> 
Expand description

Wraps the given Future with Async.

§Example

use futures_executor::block_on;

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

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

assert_eq!(42, block_on(result));