Struct futures::task::Task [] [src]

pub struct Task { /* fields omitted */ }

A handle to a "task", which represents a single lightweight "thread" of execution driving a future to completion.

In general, futures are composed into large units of work, which are then spawned as tasks onto an executor. The executor is responsible for polling the future as notifications arrive, until the future terminates.

This is obtained by the task::park function.

Methods

impl Task
[src]

Indicate that the task should attempt to poll its future in a timely fashion.

It's typically guaranteed that, for each call to unpark, poll will be called at least once subsequently (unless the task has terminated). If the task is currently polling its future when unpark is called, it must poll the future again afterwards, ensuring that all relevant events are eventually observed by the future.

Returns true when called from within the context of the task. In other words, the task is currently running on the thread calling the function.

Trait Implementations

impl Clone for Task
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Task
[src]

Formats the value using the given formatter.