| 1 |
<p align="center"> |
| 2 |
<img alt="futures-rs" src="https://raw.githubusercontent.com/rust-lang/futures-rs/gh-pages/assets/images/futures-rs-logo.svg?sanitize=true" width="400"> |
| 3 |
</p> |
| 4 |
|
| 5 |
<p align="center"> |
| 6 |
Zero-cost asynchronous programming in Rust |
| 7 |
</p> |
| 8 |
|
| 9 |
<p align="center"> |
| 10 |
<a href="https://github.com/rust-lang/futures-rs/actions?query=branch%3Amaster"> |
| 11 |
<img alt="Build Status" src="https://img.shields.io/github/actions/workflow/status/rust-lang/futures-rs/ci.yml?branch=master"> |
| 12 |
</a> |
| 13 |
|
| 14 |
<a href="https://crates.io/crates/futures"> |
| 15 |
<img alt="crates.io" src="https://img.shields.io/crates/v/futures.svg"> |
| 16 |
</a> |
| 17 |
</p> |
| 18 |
|
| 19 |
<p align="center"> |
| 20 |
<a href="https://docs.rs/futures"> |
| 21 |
Documentation |
| 22 |
</a> | <a href="https://rust-lang.github.io/futures-rs/"> |
| 23 |
Website |
| 24 |
</a> |
| 25 |
</p> |
| 26 |
|
| 27 |
`futures-rs` is a library providing the foundations for asynchronous programming in Rust. |
| 28 |
It includes key trait definitions like `Stream`, as well as utilities like `join!`, |
| 29 |
`select!`, and various futures combinator methods which enable expressive asynchronous |
| 30 |
control flow. |
| 31 |
|
| 32 |
## Usage |
| 33 |
|
| 34 |
Add this to your `Cargo.toml`: |
| 35 |
|
| 36 |
```toml |
| 37 |
[dependencies] |
| 38 |
futures = "0.3" |
| 39 |
``` |
| 40 |
|
| 41 |
The current `futures` requires Rust 1.56 or later. |
| 42 |
|
| 43 |
### Feature `std` |
| 44 |
|
| 45 |
Futures-rs works without the standard library, such as in bare metal environments. |
| 46 |
However, it has a significantly reduced API surface. To use futures-rs in |
| 47 |
a `#[no_std]` environment, use: |
| 48 |
|
| 49 |
```toml |
| 50 |
[dependencies] |
| 51 |
futures = { version = "0.3", default-features = false } |
| 52 |
``` |
| 53 |
|
| 54 |
## License |
| 55 |
|
| 56 |
Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or |
| 57 |
[MIT license](LICENSE-MIT) at your option. |
| 58 |
|
| 59 |
Unless you explicitly state otherwise, any contribution intentionally submitted |
| 60 |
for inclusion in the work by you, as defined in the Apache-2.0 license, shall |
| 61 |
be dual licensed as above, without any additional terms or conditions. |