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 Error

In Names
(10)
In Parameters
(1)
In Return Types
(51)
async_std::io::ErrorThe error type for I/O operations of the [`Read`],… 
async_std::io::ErrorKindA list specifying general categories of I/O error. 
async_std::task::Poll::from_error 
async_std::task::AccessErrorAn error returned by [`LocalKey::try_with`]. 
async_std::io::Error::raw_os_errorReturns the OS error that this error represents (if any). 
async_std::future::TimeoutErrorAn error returned when a future times out. 
async_std::io::Error::last_os_errorReturns an error representing the last OS error which… 
async_std::net::AddrParseErrorAn error which can be returned when parsing an IP address… 
async_std::path::StripPrefixErrorAn error returned from… 
async_std::io::Error::from_raw_os_errorCreates a new instance of an `Error` from a particular OS… 
async_std::io::Error::from 
async_std::io::Error::fmt 
async_std::io::IoSliceMut::fmt 
async_std::io::ErrorKind::fmt 
async_std::io::IoSlice::fmt 
async_std::io::SeekFrom::fmt 
async_std::net::Ipv6Addr::fmt 
async_std::net::AddrParseError::fmt 
async_std::net::IpAddr::fmt 
async_std::net::Ipv4Addr::fmt 
async_std::net::SocketAddrV4::fmt 
async_std::net::SocketAddrV6::fmt 
async_std::net::SocketAddr::fmt 
async_std::net::Shutdown::fmt 
async_std::path::Display::fmt 
async_std::path::StripPrefixError::fmt 
async_std::path::Prefix::fmt 
async_std::path::Component::fmt 
async_std::path::Components::fmt 
async_std::path::PrefixComponent::fmt 
async_std::path::Iter::fmt 
async_std::pin::Pin::fmt 
async_std::process::ExitStatus::fmt 
async_std::process::Output::fmt 
async_std::sync::Arc::fmt 
async_std::sync::Weak::fmt 
async_std::task::Waker::fmt 
async_std::task::Context::fmt 
async_std::task::Poll::fmt 
async_std::io::Error::newCreates a new I/O error from a known kind of error as well… 
async_std::io::Error::from 
async_std::io::Error::cause 
async_std::io::Error::source 
async_std::io::Error::get_mutReturns a mutable reference to the inner error wrapped by… 
async_std::io::Error::get_refReturns a reference to the inner error wrapped by this… 
async_std::sync::Arc::register 
async_std::sync::Arc::deregister 
async_std::sync::Arc::reregister 
async_std::io::Error::last_os_errorReturns an error representing the last OS error which… 
async_std::net::SocketAddrV6::to_socket_addrs 
async_std::net::SocketAddrV4::to_socket_addrs 
async_std::net::SocketAddr::to_socket_addrs 
async_std::io::Error::from_raw_os_errorCreates a new instance of an `Error` from a particular OS… 
async_std::pin::Pin::poll_read 
async_std::pin::Pin::poll_seek 
async_std::io::Error::into_innerConsumes the `Error`, returning its inner error (if any). 
async_std::pin::Pin::poll_close 
async_std::pin::Pin::poll_flush 
async_std::pin::Pin::poll_write 
async_std::pin::Pin::poll_fill_buf 
async_std::pin::Pin::poll_read_vectored 
async_std::pin::Pin::poll_write_vectored 

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)