Expand description
Futures, streams, and async I/O combinators.
This crate is a subset of futures that compiles an order of magnitude faster, fixes minor warts in its API, fills in some obvious gaps, and removes almost all unsafe code from it.
In short, this crate aims to be more enjoyable than futures but still fully compatible with it.
The API for this crate is intentionally constrained. Please consult the features list for APIs that are occluded from this crate.
§Examples
use futures_lite::future;
fn main() {
future::block_on(async {
println!("Hello world!");
})
}
Modules§
- future
- Combinators for the
Future
trait. - io
std
- Tools and combinators for I/O.
- prelude
- Traits
Future
,Stream
,AsyncRead
,AsyncWrite
,AsyncBufRead
,AsyncSeek
, and their extensions. - stream
- Combinators for the
Stream
trait.
Macros§
- pin
- Pins a variable of type
T
on the stack and rebinds it asPin<&mut T>
. - ready
- Unwraps
Poll<T>
or returnsPending
.
Traits§
- Async
BufRead - Read bytes asynchronously.
- Async
BufRead Ext - Extension trait for
AsyncBufRead
. - Async
Read - Read bytes asynchronously.
- Async
Read Ext - Extension trait for
AsyncRead
. - Async
Seek - Seek bytes asynchronously.
- Async
Seek Ext - Extension trait for
AsyncSeek
. - Async
Write - Write bytes asynchronously.
- Async
Write Ext - Extension trait for
AsyncWrite
. - Future
- A future represents an asynchronous computation obtained by use of
async
. - Future
Ext - Extension trait for
Future
. - Stream
- A stream of values produced asynchronously.
- Stream
Ext - Extension trait for
Stream
.