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§
- channel
- Cross-task communication.
- executor
- Task execution.
- future
- Asynchronous values.
- io
- Asynchronous I/O.
- never
- This module contains the
Nevertype. - prelude
- A “prelude” for crates using the
futurescrate. - sink
- Asynchronous sinks.
- stream
- Asynchronous streams.
- task
- Tools for working with tasks.
Macros§
- task_
local - A macro to create a
staticof typeLocalKey. - try_
ready - A macro for extracting the successful type of a
Poll<T, E>.
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.
- Future
Ext - An extension trait for
Futures that provides a variety of convenient combinator functions. - Into
Future - Types that can be converted into a future.
- Sink
- A
Sinkis a value into which other values can be sent, asynchronously. - SinkExt
- An extension trait for
Sinks that provides a variety of convenient combinator functions. - Stream
- A stream of values produced asynchronously.
- Stream
Ext - An extension trait for
Streams that provides a variety of convenient combinator functions.
Type Aliases§
- Poll
- A convenience wrapper for
Result<Async<T>, E>.