[−][src]Crate async_std
Async version of the Rust standard library.
Modules in this crate are organized in the same way as in the standard library, except blocking functions have been replaced with async functions and threads have been replaced with lightweight tasks.
More information, reading materials, and other resources:
- 🌐 The async-std website
- 📖 The async-std book
- 🐙 GitHub repository
- 📒 List of code examples
- 💬 Discord chat
Examples
Spawn a task and block the current thread on its result:
use async_std::task; fn main() { task::block_on(async { println!("Hello, world!"); }) }
Features
Items marked with
unstable
are available only when the unstable Cargo feature is enabled:
[dependencies.async-std]
version = "0.99"
features = ["unstable"]
Modules
| fs | Filesystem manipulation operations. |
| future | Asynchronous values. |
| io | Traits, helpers, and type definitions for core I/O functionality. |
| net | Networking primitives for TCP/UDP communication. |
| os | OS-specific extensions. |
| path | Cross-platform path manipulation. |
| pin | unstableTypes that pin data to its location in memory. |
| prelude | The async prelude. |
| process | unstableA module for working with processes. |
| stream | Composable asynchronous iteration. |
| sync | Synchronization primitives. |
| task | Types and traits for working with asynchronous tasks. |
Macros
| eprint | unstablePrints to the standard error. |
| eprintln | unstablePrints to the standard error, with a newline. |
unstablePrints to the standard output. | |
| println | unstablePrints to the standard output, with a newline. |
| task_local | Declares task-local values. |
| write | unstableWrites formatted data into a buffer. |
| writeln | unstableWrite formatted data into a buffer, with a newline appended. |