2019-08-12 18:29:06 +00:00
|
|
|
//! Async version of the Rust standard library.
|
2019-08-08 12:44:48 +00:00
|
|
|
//!
|
2019-09-11 14:13:17 +00:00
|
|
|
//! 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.
|
2019-08-16 15:18:39 +00:00
|
|
|
//!
|
2019-09-11 14:13:17 +00:00
|
|
|
//! More information, reading materials, and other resources:
|
2019-08-08 12:44:48 +00:00
|
|
|
//!
|
2019-09-11 14:13:17 +00:00
|
|
|
//! * [🌐 The async-std website](https://async.rs/)
|
|
|
|
//! * [📖 The async-std book](https://book.async.rs)
|
|
|
|
//! * [🐙 GitHub repository](https://github.com/async-rs/async-std)
|
|
|
|
//! * [📒 List of code examples](https://github.com/async-rs/async-std/tree/master/examples)
|
|
|
|
//! * [💬 Discord chat](https://discord.gg/JvZeVNe)
|
2019-08-08 12:44:48 +00:00
|
|
|
//!
|
|
|
|
//! # 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!");
|
|
|
|
//! })
|
|
|
|
//! }
|
|
|
|
//! ```
|
2019-08-16 14:36:44 +00:00
|
|
|
//!
|
2019-09-11 14:13:17 +00:00
|
|
|
//! # Features
|
|
|
|
//!
|
2019-09-21 08:39:56 +00:00
|
|
|
//! Items marked with
|
|
|
|
//! <span
|
|
|
|
//! class="module-item stab portability"
|
|
|
|
//! style="display: inline; border-radius: 3px; padding: 2px; font-size: 80%; line-height: 1.2;"
|
|
|
|
//! ><code>unstable</code></span>
|
|
|
|
//! are available only when the `unstable` Cargo feature is enabled:
|
2019-09-11 14:13:17 +00:00
|
|
|
//!
|
|
|
|
//! ```toml
|
|
|
|
//! [dependencies.async-std]
|
|
|
|
//! version = "0.99"
|
|
|
|
//! features = ["unstable"]
|
|
|
|
//! ```
|
2019-08-08 12:44:48 +00:00
|
|
|
|
2019-08-12 17:50:30 +00:00
|
|
|
#![cfg_attr(feature = "docs", feature(doc_cfg))]
|
2019-08-08 12:44:48 +00:00
|
|
|
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
|
2019-08-14 02:22:37 +00:00
|
|
|
#![doc(test(attr(deny(rust_2018_idioms, warnings))))]
|
|
|
|
#![doc(test(attr(allow(unused_extern_crates, unused_variables))))]
|
2019-08-12 10:43:28 +00:00
|
|
|
#![doc(html_logo_url = "https://async.rs/images/logo--hero.svg")]
|
2019-09-26 11:46:29 +00:00
|
|
|
#![recursion_limit = "1024"]
|
2019-08-08 12:44:48 +00:00
|
|
|
|
2019-10-17 17:17:49 +00:00
|
|
|
#[macro_use]
|
|
|
|
mod utils;
|
2019-09-17 23:26:04 +00:00
|
|
|
|
2019-08-08 12:44:48 +00:00
|
|
|
pub mod fs;
|
|
|
|
pub mod future;
|
|
|
|
pub mod io;
|
|
|
|
pub mod net;
|
|
|
|
pub mod os;
|
2019-10-13 11:06:39 +00:00
|
|
|
pub mod path;
|
2019-08-08 12:44:48 +00:00
|
|
|
pub mod prelude;
|
|
|
|
pub mod stream;
|
|
|
|
pub mod sync;
|
|
|
|
pub mod task;
|
2019-09-17 23:26:04 +00:00
|
|
|
|
2019-10-17 17:17:49 +00:00
|
|
|
cfg_unstable! {
|
|
|
|
pub mod pin;
|
|
|
|
pub mod process;
|
2019-09-21 08:39:56 +00:00
|
|
|
|
2019-10-17 17:17:49 +00:00
|
|
|
mod unit;
|
|
|
|
mod vec;
|
|
|
|
mod result;
|
|
|
|
mod option;
|
|
|
|
mod string;
|
|
|
|
mod collections;
|
|
|
|
|
|
|
|
#[doc(inline)]
|
|
|
|
pub use std::{write, writeln};
|
2019-09-17 23:26:04 +00:00
|
|
|
}
|
2019-08-08 12:44:48 +00:00
|
|
|
|
2019-10-13 10:13:29 +00:00
|
|
|
mod macros;
|