Function promising_future::future_promise [] [src]

pub fn future_promise<T>() -> (Future<T>, Promise<T>)

Construct a Future/Promise pair.

A Future represents a value which may not yet be known. A Promise is some process which will determine that value. This function produces a bound Future/Promise pair. If the Promise is dropped before the value is set, then the Future will never return a value. If the Future is dropped before fetching the value, or before the value is set, then the Promise's value is lost.

let (fut, prom) = future_promise::<i32>();