Expand description
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§
- Cross-task communication.
- Task execution.
- Asynchronous values.
- Asynchronous I/O.
- This module contains the
Never
type. - A “prelude” for crates using the
futures
crate. - Asynchronous sinks.
- Asynchronous streams.
- Tools for working with tasks.
Macros§
- A macro to create a
static
of typeLocalKey
. - A macro for extracting the successful type of a
Poll<T, E>
.
Enums§
- Indicates whether a value is available, or if the current task has been scheduled for later wake-up instead.
- A type with no possible values.
Traits§
- A future represents an asychronous computation that may fail.
- An extension trait for
Future
s that provides a variety of convenient combinator functions. - Types that can be converted into a future.
- A
Sink
is a value into which other values can be sent, asynchronously. - An extension trait for
Sink
s that provides a variety of convenient combinator functions. - A stream of values produced asynchronously.
- An extension trait for
Stream
s that provides a variety of convenient combinator functions.
Type Aliases§
- A convenience wrapper for
Result<Async<T>, E>
.