Docs.rs
  • async-std-0.99.10
    • async-std 0.99.10
    • Docs.rs crate page
    • Apache-2.0/MIT
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • skade
    • yoshuawuyts
    • Keruspe
    • joshtriplett
    • dignifiedquire
    • Dependencies
      • async-macros ^1.0.0 normal
      • async-task ^1.0.0 normal
      • broadcaster ^0.2.6 normal
      • cfg-if ^0.1.9 normal
      • crossbeam-channel ^0.3.9 normal
      • crossbeam-deque ^0.7.1 normal
      • futures-core-preview = 0.3.0-alpha.19 normal
      • futures-io-preview = 0.3.0-alpha.19 normal
      • futures-timer ^1.0.2 normal
      • kv-log-macro ^1.0.4 normal
      • lazy_static ^1.4.0 normal
      • log ^0.4.8 normal
      • memchr ^2.2.1 normal
      • mio ^0.6.19 normal
      • mio-uds ^0.6.7 normal
      • num_cpus ^1.10.1 normal
      • pin-utils ^0.1.0-alpha.4 normal
      • slab ^0.4.2 normal
      • femme ^1.2.0 dev
      • futures-channel-preview = 0.3.0-alpha.19 dev
      • futures-preview = 0.3.0-alpha.19 dev
      • futures-util-preview = 0.3.0-alpha.19 dev
      • tempdir ^0.3.7 dev
    • Versions
  • Go to latest version
  • Platform
    • i686-apple-darwin
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation
☰
logo

Crate async_std

See all async_std's items

  • Modules
  • Macros

Crates

  • async_std
Change settings

[−][src]Crate async_std

[−] Expand description

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.

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.

Results for read

In Names
(52)
In Parameters
(1)
In Return Types
(1)
async_std::fs::readReads the entire contents of a file as raw bytes. 
async_std::io::ReadAllows reading from a byte stream. 
async_std::fs::OpenOptions::readConfigures the option for read mode. 
async_std::io::Read::readReads some bytes from the byte stream. 
async_std::sync::RwLock::readAcquires a read lock. 
async_std::net::Shutdown::ReadThe reading portion of the [`TcpStream`] should be shut… 
async_std::future::readyResolves to the provided value. 
async_std::task::Poll::ReadyRepresents that a value is immediately ready. 
async_std::task::readyExtracts the successful type of a `Poll<T>`. 
async_std::io::BufReadAllows reading from a buffered byte stream. 
async_std::fs::ReadDirA stream of entries in a directory. 
async_std::task::Poll::is_readyReturns `true` if this is `Poll::Ready` 
async_std::fs::read_dirReturns a stream of entries in a directory. 
async_std::path::Path::read_dirReturns an iterator over the entries within a directory. 
async_std::fs::Permissions::readonlyReturns the read-only flag. 
async_std::sync::RwLock::try_readAttempts to acquire a read lock. 
async_std::io::BufReaderAdds buffering to any reader. 
async_std::io::Read::poll_readAttempt to read from the `AsyncRead` into `buf`. 
async_std::fs::File::poll_read 
async_std::io::BufReader::poll_read 
async_std::io::Cursor::poll_read 
async_std::io::Empty::poll_read 
async_std::io::Repeat::poll_read 
async_std::io::Stdin::poll_read 
async_std::net::TcpStream::poll_read 
async_std::os::unix::net::UnixStream::poll_read 
async_std::pin::Pin::poll_read 
async_std::io::Stdin::read_lineReads a line of input into the specified buffer. 
async_std::io::BufRead::read_lineReads all bytes and appends them into `buf` until a… 
async_std::fs::read_linkReads a symbolic link and returns the path it points to. 
async_std::path::Path::read_linkReads a symbolic link, returning the file that the link… 
async_std::pin::Pin::poll_ready 
async_std::io::Read::read_exactReads the exact number of bytes required to fill `buf`. 
async_std::io::BufRead::read_untilReads all bytes into `buf` until the delimiter `byte` or… 
async_std::io::Read::read_to_endReads all bytes from the byte stream. 
async_std::fs::Permissions::set_readonlyConfigures the read-only flag. 
async_std::io::ErrorKind::AlreadyExistsAn entity already exists, often a file. 
async_std::io::Read::read_vectoredLike [`read`], except that it reads into a slice of buffers. 
async_std::fs::read_to_stringReads the entire contents of a file as a string. 
async_std::io::Read::read_to_stringReads all bytes from the byte stream and appends them into… 
async_std::sync::RwLockReadGuardA guard that releases the read lock when dropped. 
async_std::io::Read::poll_read_vectoredAttempt to read from the `AsyncRead` into `bufs` using… 
async_std::io::BufReader::poll_read_vectored 
async_std::io::Cursor::poll_read_vectored 
async_std::net::TcpStream::poll_read_vectored 
async_std::pin::Pin::poll_read_vectored 
async_std::io::SeekFrom::EndSets the offset to the size of this object plus the… 
async_std::net::UdpSocket::recvReceives data from the socket. 
async_std::os::unix::net::UnixDatagram::recvReceives data from the socket. 
async_std::net::UdpSocket::sendSends data on the socket to the given address. 
async_std::os::unix::net::UnixDatagram::sendSends data on the socket to the socket's peer. 
async_std::sync::Weak`Weak` is a version of [`Arc`] that holds a non-owning… 
async_std::io::Read::chainCreates an adaptor which will chain this stream with… 
async_std::io::Read::chainCreates an adaptor which will chain this stream with… 

Help

Keyboard Shortcuts

?
Show this help dialog
S
Focus the search field
↑
Move up in search results
↓
Move down in search results
↹
Switch tab
⏎
Go to active search result
+
Expand all sections
-
Collapse all sections

Search Tricks

Prefix searches with a type followed by a colon (e.g., fn:) to restrict the search to a given type.

Accepted types are: fn, mod, struct, enum, trait, type, macro, and const.

Search functions by type signature (e.g., vec -> usize or * -> vec)

Search multiple things at once by splitting your query with comma (e.g., str,u8 or String,struct:Vec,test)