Crate futures [−] [src]
Abstractions for asynchronous programming
This crate provides a number of core abstractions for writing asynchronous code:
-
Futures (sometimes called promises), which represent a single asychronous computation that may result in a final value or an error.
-
Streams, which represent a series of values or errors produced asynchronously.
-
Sinks, which support asynchronous writing of data.
-
Executors, which 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 communciation. |
executor |
Task execution. |
future |
Asynchronous values. |
io |
Asynchronous I/O. |
never |
This module contains the |
prelude |
A "prelude" for crates using the |
sink |
Asynchronous sinks. |
stream |
Asynchronous streams. |
task |
Tools for working with tasks. |
Macros
task_local |
A macro to create a |
try_ready |
A macro for extracting the successful type of a |
Enums
Async |
Indicates whether a value is available, or if the current task has been scheduled for later wake-up instead. |
Never |
A type with no possible values. |
Traits
Future |
A future represents an asychronous computation that may fail. |
FutureExt |
An extension trait for |
IntoFuture |
Types that can be converted into a future. |
Sink |
A |
SinkExt |
An extension trait for |
Stream |
A stream of values produced asynchronously. |
StreamExt |
An extension trait for |
Type Definitions
Poll |
A convenience wrapper for |