Struct futures::TaskHandle [] [src]

pub struct TaskHandle {
    // some fields omitted
}

A handle to a task that can be sent to other threads.

Created by the Task::handle method.

Methods

impl TaskHandle
[src]

fn equivalent(&self, other: &TaskHandle) -> bool

Returns whether this task handle and another point to the same task.

In other words, this method returns whether notify would end up notifying the same task. If two task handles need to be notified but they are equivalent, then only one needs to be actually notified.

fn get<A>(&self, data: &TaskNotifyData<A>) -> &A

dox

fn notify(&self)

Notify the associated task that a future is ready to get polled.

Futures should use this method to ensure that when a future can make progress as Task is notified that it should continue to poll the future at a later date.

Currently it's guaranteed that if notify is called that poll will be scheduled to get called at some point in the future. A poll may already be running on another thread, but this will ensure that a poll happens again to receive this notification.

Trait Implementations

impl Clone for TaskHandle
[src]

fn clone(&self) -> TaskHandle

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more