Struct std::sync::Future [] [src]

pub struct Future<A> {
    // some fields omitted
}
Deprecated since 1.2.0

: implementation does not match the quality of the standard library and this will likely be prototyped outside in crates.io first

A type encapsulating the result of a computation which may not be complete

Methods

impl<A: Clone> Future<A>

Methods on the future type

fn get(&mut self) -> A

Deprecated since 1.2.0

: implementation does not match the quality of the standard library and this will likely be prototyped outside in crates.io first

Get the value of the future.

impl<A> Future<A>

fn into_inner(self) -> A

Deprecated since 1.2.0

: implementation does not match the quality of the standard library and this will likely be prototyped outside in crates.io first

Gets the value from this future, forcing evaluation.

fn get_ref<'a>(&'a mut self) -> &'a A

Deprecated since 1.2.0

: implementation does not match the quality of the standard library and this will likely be prototyped outside in crates.io first

Executes the future's closure and then returns a reference to the result. The reference lasts as long as the future.

fn from_value(val: A) -> Future<A>

Deprecated since 1.2.0

: implementation does not match the quality of the standard library and this will likely be prototyped outside in crates.io first

Create a future from a value.

The value is immediately available and calling get later will not block.

fn from_fn<F>(f: F) -> Future<A> where F: FnOnce() -> A, F: Send + 'static

Deprecated since 1.2.0

: implementation does not match the quality of the standard library and this will likely be prototyped outside in crates.io first

Create a future from a function.

The first time that the value is requested it will be retrieved by calling the function. Note that this function is a local function. It is not spawned into another task.

impl<A: Send + 'static> Future<A>

fn from_receiver(rx: Receiver<A>) -> Future<A>

Deprecated since 1.2.0

: implementation does not match the quality of the standard library and this will likely be prototyped outside in crates.io first

Create a future from a port

The first time that the value is requested the task will block waiting for the result to be received on the port.

fn spawn<F>(blk: F) -> Future<A> where F: FnOnce() -> A, F: Send + 'static

Deprecated since 1.2.0

: implementation does not match the quality of the standard library and this will likely be prototyped outside in crates.io first

Create a future from a unique closure.

The closure will be run in a new task and its result used as the value of the future.