Struct promising_future::Promise
[−]
[src]
pub struct Promise<T: Send>(_);
A box for resolving a Future.
A Promise is a write-once box which corresponds with a Future and may be used to resolve it.
A Promise is initially pending, and is completed once it is consumed, either by its set
method, or by going out of scope. The former is "fulfilling" the Promise; the latter is
leaving it "unfulfilled".
It may only be created in a pair with a Future using the function future_promise().
Methods
impl<T: Send> Promise<T>[src]
fn set(self, v: T)
Fulfill the Promise by resolving the corresponding Future with a value.
fn canceled(&self) -> bool
Return true if the corresponding Future no longer exists, and so any value set would be
discarded.