19 releases (5 stable)

✓ Uses Rust 2018 edition

new 1.3.0 Dec 13, 2019
1.2.0 Nov 27, 2019
0.99.12 Nov 8, 2019
0.99.11 Oct 29, 2019
0.1.0 May 30, 2019

#5 in Asynchronous

Download history 500/week @ 2019-08-30 446/week @ 2019-09-06 657/week @ 2019-09-13 672/week @ 2019-09-20 750/week @ 2019-09-27 884/week @ 2019-10-04 972/week @ 2019-10-11 1080/week @ 2019-10-18 1007/week @ 2019-10-25 1913/week @ 2019-11-01 4840/week @ 2019-11-08 4907/week @ 2019-11-15 5440/week @ 2019-11-22 6264/week @ 2019-11-29 7742/week @ 2019-12-06

12,434 downloads per month
Used in 67 crates (65 directly)

Apache-2.0/MIT

780KB
15K SLoC

async-std

Async version of the Rust standard library


This crate provides an async version of std. It provides all the interfaces you are used to, but in an async version and ready for Rust's async/await syntax.

Features

  • Modern: Built from the ground up for std::future and async/await with blazing fast compilation time.
  • Fast: Our robust allocator and threadpool designs provide ultra-high throughput with predictably low latency.
  • Intuitive: Complete parity with the stdlib means you only need to learn APIs once.
  • Clear: Detailed documentation and accessible guides mean using async Rust was never easier.

Examples

use async_std::task;

async fn say_hello() {
    println!("Hello, world!");
}

fn main() {
    task::block_on(say_hello())
}

More examples, including networking and file access, can be found in our examples directory and in our documentation.

Philosophy

We believe Async Rust should be as easy to pick up as Sync Rust. We also believe that the best API is the one you already know. And finally, we believe that providing an asynchronous counterpart to the standard library is the best way stdlib provides a reliable basis for both performance and productivity.

Async-std is the embodiment of that vision. It combines single-allocation task creation, with an adaptive lock-free executor, threadpool and network driver to create a smooth system that processes work at a high pace with low latency, using Rust's familiar stdlib API.

Installation

With cargo add installed run:

$ cargo add async-std

We also provide a set of "unstable" features with async-std. See the features documentation on how to enable them.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1.3–2MB
~36K SLoC