Crate futures[−][src]
Abstractions for asynchronous programming.
This crate provides a number of core abstractions for writing asynchronous code:
- Futures are single eventual values produced by asychronous computations. Some programming languages (e.g. JavaScript) call this concept "promise".
- Streams represent a series of values produced asynchronously.
- Sinks provide support for asynchronous writing of data.
- Executors are responsible for running asynchronous tasks.
The crate also contains abstractions for asynchronous I/O and cross-task communication.
Underlying all of this is the task system, which is a form of lightweight threading. Large asynchronous computations are built up using futures, streams and sinks, and then spawned as independent tasks that are run to completion, but do not block the thread running them.
Modules
channel |
Cross-task communication. |
executor |
Task execution. |
future |
Asynchronous values. |
io |
Asynchronous I/O. |
prelude |
A "prelude" for crates using the |
sink |
Asynchronous sinks. |
stream |
Asynchronous streams. |
task |
Tools for working with tasks. |
Macros
join |
Polls multiple futures simultaneously, returning a tuple of all results once complete. |
pending |
A macro which yields to the event loop once. |
pin_mut |
Pins a value on the stack. |
poll |
A macro which returns the result of polling a future once within the
current |
ready |
Extracts the successful type of a |
select |
Polls multiple futures simultaneously, executing the branch for the future that finishes first. |
try_poll |
Extracts |
try_ready |
Extracts the successful type of a |
unsafe_pinned |
A pinned projection of a struct field. |
unsafe_unpinned |
An unpinned projection of a struct field. |