[−][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 | unstable Types that pin data to its location in memory. |
prelude | The async prelude. |
process | unstable A module for working with processes. |
stream | Composable asynchronous iteration. |
sync | Synchronization primitives. |
task | Types and traits for working with asynchronous tasks. |
Macros
eprint | unstable Prints to the standard error. |
eprintln | unstable Prints to the standard error, with a newline. |
unstable Prints to the standard output. | |
println | unstable Prints to the standard output, with a newline. |
task_local | Declares task-local values. |
write | unstable Writes formatted data into a buffer. |
writeln | unstable Write formatted data into a buffer, with a newline appended. |