[][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:

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.

pinunstable

Types that pin data to its location in memory.

prelude

The async prelude.

processunstable

A module for working with processes.

stream

Composable asynchronous iteration.

sync

Synchronization primitives.

task

Types and traits for working with asynchronous tasks.

Macros

eprintunstable

Prints to the standard error.

eprintlnunstable

Prints to the standard error, with a newline.

printunstable

Prints to the standard output.

printlnunstable

Prints to the standard output, with a newline.

task_local

Declares task-local values.

writeunstable

Writes formatted data into a buffer.

writelnunstable

Write formatted data into a buffer, with a newline appended.