forked from mirror/async-std
remove async_await feature gate
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
This commit is contained in:
parent
0156dc879b
commit
63ad786768
86 changed files with 1 additions and 206 deletions
|
@ -38,8 +38,6 @@ $ cargo add async-std
|
|||
## Hello world
|
||||
|
||||
```rust
|
||||
#![feature(async_await)]
|
||||
|
||||
use async_std::task;
|
||||
|
||||
fn main() {
|
||||
|
@ -52,8 +50,6 @@ fn main() {
|
|||
## Low-Friction Sockets with Built-In Timeouts
|
||||
|
||||
```rust
|
||||
#![feature(async_await)]
|
||||
|
||||
use std::time::Duration;
|
||||
|
||||
use async_std::{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(async_await, test)]
|
||||
#![feature(test)]
|
||||
|
||||
extern crate test;
|
||||
|
||||
|
|
|
@ -6,8 +6,6 @@ Let's implement the scaffold of the server: a loop that binds a TCP socket to an
|
|||
First of all, let's add required import boilerplate:
|
||||
|
||||
```rust
|
||||
#![feature(async_await)]
|
||||
|
||||
use std::net::ToSocketAddrs; // 1
|
||||
|
||||
use async_std::{
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
At this point, we only need to start the broker to get a fully-functioning (in the happy case!) chat:
|
||||
|
||||
```rust
|
||||
#![feature(async_await)]
|
||||
|
||||
use std::{
|
||||
net::ToSocketAddrs,
|
||||
sync::Arc,
|
||||
|
|
|
@ -95,8 +95,6 @@ This also allows us to establish a useful invariant that the message channel str
|
|||
The final code looks like this:
|
||||
|
||||
```rust
|
||||
#![feature(async_await)]
|
||||
|
||||
use std::{
|
||||
net::ToSocketAddrs,
|
||||
sync::Arc,
|
||||
|
|
|
@ -15,8 +15,6 @@ Programming this with threads is cumbersome, especially when implementing clean
|
|||
With async, we can just use the `select!` macro.
|
||||
|
||||
```rust
|
||||
#![feature(async_await)]
|
||||
|
||||
use std::net::ToSocketAddrs;
|
||||
|
||||
use futures::select;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Spawns a task that says hello.
|
||||
|
||||
#![feature(async_await)]
|
||||
|
||||
use async_std::task;
|
||||
|
||||
async fn say_hi() {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Counts the number of lines in a file given as an argument.
|
||||
|
||||
#![feature(async_await)]
|
||||
|
||||
use std::env::args;
|
||||
|
||||
use async_std::fs::File;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Lists files in a directory given as an argument.
|
||||
|
||||
#![feature(async_await)]
|
||||
|
||||
use std::env::args;
|
||||
|
||||
use async_std::fs;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Prints the runtime's execution log on the standard output.
|
||||
|
||||
#![feature(async_await)]
|
||||
|
||||
use async_std::task;
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Prints a file given as an argument to stdout.
|
||||
|
||||
#![feature(async_await)]
|
||||
|
||||
use std::env::args;
|
||||
|
||||
use async_std::fs::File;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Echoes lines read on stdin to stdout.
|
||||
|
||||
#![feature(async_await)]
|
||||
|
||||
use async_std::io;
|
||||
use async_std::prelude::*;
|
||||
use async_std::task;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Reads a line from stdin, or exits with an error if nothing is read in 5 seconds.
|
||||
|
||||
#![feature(async_await)]
|
||||
|
||||
use std::time::Duration;
|
||||
|
||||
use async_std::io;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Sends an HTTP request to the Rust website.
|
||||
|
||||
#![feature(async_await)]
|
||||
|
||||
use async_std::task;
|
||||
|
||||
fn main() -> Result<(), surf::Exception> {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Creates a task-local value.
|
||||
|
||||
#![feature(async_await)]
|
||||
|
||||
use std::cell::Cell;
|
||||
|
||||
use async_std::prelude::*;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Spawns a named task that prints its name.
|
||||
|
||||
#![feature(async_await)]
|
||||
|
||||
use async_std::task;
|
||||
|
||||
async fn print_name() {
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
//! $ cargo run --example tcp-client
|
||||
//! ```
|
||||
|
||||
#![feature(async_await)]
|
||||
|
||||
use async_std::io;
|
||||
use async_std::net::TcpStream;
|
||||
use async_std::prelude::*;
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
//! $ nc localhost 8080
|
||||
//! ```
|
||||
|
||||
#![feature(async_await)]
|
||||
|
||||
use async_std::io;
|
||||
use async_std::net::{TcpListener, TcpStream};
|
||||
use async_std::prelude::*;
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
//! $ cargo run --example udp-client
|
||||
//! ```
|
||||
|
||||
#![feature(async_await)]
|
||||
|
||||
use async_std::io;
|
||||
use async_std::net::UdpSocket;
|
||||
use async_std::task;
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
//! $ nc -u localhost 8080
|
||||
//! ```
|
||||
|
||||
#![feature(async_await)]
|
||||
|
||||
use async_std::io;
|
||||
use async_std::net::UdpSocket;
|
||||
use async_std::task;
|
||||
|
|
|
@ -23,7 +23,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -27,7 +27,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -21,7 +21,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -20,7 +20,6 @@ use crate::io;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -73,7 +73,6 @@ impl DirBuilder {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::DirBuilder;
|
||||
|
|
|
@ -74,7 +74,6 @@ impl DirEntry {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
@ -100,7 +99,6 @@ impl DirEntry {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
@ -154,7 +152,6 @@ impl DirEntry {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
@ -206,7 +203,6 @@ impl DirEntry {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -33,7 +33,6 @@ use crate::task::{blocking, Context, Poll};
|
|||
/// Create a new file and write some bytes to it:
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -48,7 +47,6 @@ use crate::task::{blocking, Context, Poll};
|
|||
/// Read the contents of a file into a `Vec<u8>`:
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -124,7 +122,6 @@ impl File {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -171,7 +168,6 @@ impl File {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -218,7 +214,6 @@ impl File {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -274,7 +269,6 @@ impl File {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -334,7 +328,6 @@ impl File {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -381,7 +374,6 @@ impl File {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -433,7 +425,6 @@ impl File {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
|
|
@ -22,7 +22,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -22,7 +22,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
//! Create a new file and write some bytes to it:
|
||||
//!
|
||||
//! ```no_run
|
||||
//! # #![feature(async_await)]
|
||||
//! # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
//! #
|
||||
//! use async_std::fs::File;
|
||||
|
|
|
@ -32,7 +32,6 @@ use crate::task::blocking;
|
|||
/// Opening a file for reading:
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::OpenOptions;
|
||||
|
@ -48,7 +47,6 @@ use crate::task::blocking;
|
|||
/// Opening a file for both reading and writing, creating it if it doesn't exist:
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::OpenOptions;
|
||||
|
@ -73,7 +71,6 @@ impl OpenOptions {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::OpenOptions;
|
||||
|
@ -96,7 +93,6 @@ impl OpenOptions {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::OpenOptions;
|
||||
|
@ -123,7 +119,6 @@ impl OpenOptions {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::OpenOptions;
|
||||
|
@ -169,7 +164,6 @@ impl OpenOptions {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::OpenOptions;
|
||||
|
@ -196,7 +190,6 @@ impl OpenOptions {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::OpenOptions;
|
||||
|
@ -226,7 +219,6 @@ impl OpenOptions {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::OpenOptions;
|
||||
|
@ -263,7 +255,6 @@ impl OpenOptions {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::OpenOptions;
|
||||
|
@ -316,7 +307,6 @@ impl OpenOptions {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::OpenOptions;
|
||||
|
|
|
@ -24,7 +24,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -30,7 +30,6 @@ use crate::task::{blocking, Context, Poll};
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -20,7 +20,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -20,7 +20,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -20,7 +20,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -20,7 +20,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -20,7 +20,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -21,7 +21,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -20,7 +20,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -20,7 +20,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -22,7 +22,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
///
|
||||
/// # Examples
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use std::time::Duration;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::future;
|
||||
|
|
|
@ -46,7 +46,6 @@ pub trait BufRead {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -97,7 +96,6 @@ pub trait BufRead {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -138,7 +136,6 @@ pub trait BufRead {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
|
|
@ -31,7 +31,6 @@ const DEFAULT_CAPACITY: usize = 8 * 1024;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -60,7 +59,6 @@ impl<R: AsyncRead> BufReader<R> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -79,7 +77,6 @@ impl<R: AsyncRead> BufReader<R> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -117,7 +114,6 @@ impl<R> BufReader<R> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -139,7 +135,6 @@ impl<R> BufReader<R> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -161,7 +156,6 @@ impl<R> BufReader<R> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -183,7 +177,6 @@ impl<R> BufReader<R> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
|
|
@ -28,7 +28,6 @@ use crate::io;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::io;
|
||||
|
|
|
@ -11,7 +11,6 @@ use crate::task::{Context, Poll};
|
|||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::io;
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
//! Read a line from the standard input:
|
||||
//!
|
||||
//! ```no_run
|
||||
//! # #![feature(async_await)]
|
||||
//! # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
//! #
|
||||
//! use async_std::io;
|
||||
|
|
|
@ -52,7 +52,6 @@ pub trait Read {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -102,7 +101,6 @@ pub trait Read {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -140,7 +138,6 @@ pub trait Read {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -193,7 +190,6 @@ pub trait Read {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
|
|
@ -43,7 +43,6 @@ pub trait Seek {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
|
|
@ -11,7 +11,6 @@ use crate::task::{Context, Poll};
|
|||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::io;
|
||||
|
|
|
@ -17,7 +17,6 @@ use crate::task::{blocking, Context, Poll};
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::io;
|
||||
|
|
|
@ -18,7 +18,6 @@ use crate::task::{blocking, Context, Poll};
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::io;
|
||||
|
@ -92,7 +91,6 @@ impl Stdin {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::io;
|
||||
|
|
|
@ -17,7 +17,6 @@ use crate::task::{blocking, Context, Poll};
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::io;
|
||||
|
|
|
@ -13,7 +13,6 @@ use crate::task::{Context, Poll};
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use std::time::Duration;
|
||||
|
|
|
@ -47,7 +47,6 @@ pub trait Write {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -68,7 +67,6 @@ pub trait Write {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
@ -114,7 +112,6 @@ pub trait Write {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::fs::File;
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
//! Spawn a task and block the current thread on its result:
|
||||
//!
|
||||
//! ```
|
||||
//! # #![feature(async_await)]
|
||||
//! use async_std::task;
|
||||
//!
|
||||
//! fn main() {
|
||||
|
@ -27,7 +26,6 @@
|
|||
//! See [here](https://github.com/async-rs/async-std/tree/master/examples)
|
||||
//! for more examples.
|
||||
|
||||
#![feature(async_await)]
|
||||
#![cfg_attr(feature = "docs", feature(doc_cfg))]
|
||||
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
|
||||
#![doc(test(attr(deny(rust_2018_idioms, warnings))))]
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
//! A simple UDP echo server:
|
||||
//!
|
||||
//! ```no_run
|
||||
//! # #![feature(async_await)]
|
||||
//! # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
//! #
|
||||
//! use async_std::net::UdpSocket;
|
||||
|
|
|
@ -30,7 +30,6 @@ use crate::task::{Context, Poll};
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::io;
|
||||
|
@ -70,7 +69,6 @@ impl TcpListener {
|
|||
/// Create a TCP listener bound to 127.0.0.1:0:
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::TcpListener;
|
||||
|
@ -119,7 +117,6 @@ impl TcpListener {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::TcpListener;
|
||||
|
@ -172,7 +169,6 @@ impl TcpListener {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::TcpListener;
|
||||
|
@ -200,7 +196,6 @@ impl TcpListener {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::TcpListener;
|
||||
|
|
|
@ -34,7 +34,6 @@ use crate::task::{Context, Poll};
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::TcpStream;
|
||||
|
@ -70,7 +69,6 @@ impl TcpStream {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::TcpStream;
|
||||
|
@ -155,7 +153,6 @@ impl TcpStream {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::TcpStream;
|
||||
|
@ -174,7 +171,6 @@ impl TcpStream {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::TcpStream;
|
||||
|
@ -197,7 +193,6 @@ impl TcpStream {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::TcpStream;
|
||||
|
@ -221,7 +216,6 @@ impl TcpStream {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::TcpStream;
|
||||
|
@ -248,7 +242,6 @@ impl TcpStream {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::TcpStream;
|
||||
|
@ -286,7 +279,6 @@ impl TcpStream {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::TcpStream;
|
||||
|
@ -313,7 +305,6 @@ impl TcpStream {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::TcpStream;
|
||||
|
@ -339,7 +330,6 @@ impl TcpStream {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use std::net::Shutdown;
|
||||
|
|
|
@ -29,7 +29,6 @@ use crate::task::Poll;
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::UdpSocket;
|
||||
|
@ -65,7 +64,6 @@ impl UdpSocket {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::UdpSocket;
|
||||
|
@ -114,7 +112,6 @@ impl UdpSocket {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::UdpSocket;
|
||||
|
@ -135,7 +132,6 @@ impl UdpSocket {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::UdpSocket;
|
||||
|
@ -188,7 +184,6 @@ impl UdpSocket {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::UdpSocket;
|
||||
|
@ -230,7 +225,6 @@ impl UdpSocket {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::UdpSocket;
|
||||
|
@ -265,7 +259,6 @@ impl UdpSocket {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::UdpSocket;
|
||||
|
@ -308,7 +301,6 @@ impl UdpSocket {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::net::UdpSocket;
|
||||
|
@ -442,7 +434,6 @@ impl UdpSocket {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use std::net::Ipv4Addr;
|
||||
|
@ -472,7 +463,6 @@ impl UdpSocket {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use std::net::{Ipv6Addr, SocketAddr};
|
||||
|
|
|
@ -18,7 +18,6 @@ use crate::task::blocking;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::fs::symlink;
|
||||
|
|
|
@ -29,7 +29,6 @@ use crate::task::{blocking, Poll};
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixDatagram;
|
||||
|
@ -63,7 +62,6 @@ impl UnixDatagram {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixDatagram;
|
||||
|
@ -83,7 +81,6 @@ impl UnixDatagram {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixDatagram;
|
||||
|
@ -104,7 +101,6 @@ impl UnixDatagram {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixDatagram;
|
||||
|
@ -132,7 +128,6 @@ impl UnixDatagram {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixDatagram;
|
||||
|
@ -153,7 +148,6 @@ impl UnixDatagram {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixDatagram;
|
||||
|
@ -176,7 +170,6 @@ impl UnixDatagram {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixDatagram;
|
||||
|
@ -198,7 +191,6 @@ impl UnixDatagram {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixDatagram;
|
||||
|
@ -232,7 +224,6 @@ impl UnixDatagram {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixDatagram;
|
||||
|
@ -266,7 +257,6 @@ impl UnixDatagram {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixDatagram;
|
||||
|
@ -299,7 +289,6 @@ impl UnixDatagram {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixDatagram;
|
||||
|
@ -336,7 +325,6 @@ impl UnixDatagram {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixDatagram;
|
||||
|
|
|
@ -33,7 +33,6 @@ use crate::task::{blocking, Context, Poll};
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixListener;
|
||||
|
@ -62,7 +61,6 @@ impl UnixListener {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixListener;
|
||||
|
@ -88,7 +86,6 @@ impl UnixListener {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixListener;
|
||||
|
@ -136,7 +133,6 @@ impl UnixListener {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixListener;
|
||||
|
@ -161,7 +157,6 @@ impl UnixListener {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixListener;
|
||||
|
|
|
@ -26,7 +26,6 @@ use crate::task::{blocking, Context, Poll};
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixStream;
|
||||
|
@ -53,7 +52,6 @@ impl UnixStream {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixStream;
|
||||
|
@ -115,7 +113,6 @@ impl UnixStream {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixStream;
|
||||
|
@ -142,7 +139,6 @@ impl UnixStream {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixStream;
|
||||
|
@ -161,7 +157,6 @@ impl UnixStream {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixStream;
|
||||
|
@ -183,7 +178,6 @@ impl UnixStream {
|
|||
/// [`Shutdown`]: https://doc.rust-lang.org/std/net/enum.Shutdown.html
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::os::unix::net::UnixStream;
|
||||
|
|
|
@ -8,7 +8,6 @@ use crate::task::{Context, Poll};
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::prelude::*;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
//! # Examples
|
||||
//!
|
||||
//! ```
|
||||
//! # #![feature(async_await)]
|
||||
//! # fn main() { async_std::task::block_on(async {
|
||||
//! #
|
||||
//! use async_std::prelude::*;
|
||||
|
|
|
@ -7,7 +7,6 @@ use crate::task::{Context, Poll};
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::prelude::*;
|
||||
|
|
|
@ -7,7 +7,6 @@ use crate::task::{Context, Poll};
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::prelude::*;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
//! # Examples
|
||||
//!
|
||||
//! ```
|
||||
//! # #![feature(async_await)]
|
||||
//! # fn main() { async_std::task::block_on(async {
|
||||
//! #
|
||||
//! use async_std::prelude::*;
|
||||
|
@ -69,7 +68,6 @@ pub trait Stream {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::prelude::*;
|
||||
|
@ -91,7 +89,6 @@ pub trait Stream {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::prelude::*;
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
//! Spawn a task that updates an integer protected by a mutex:
|
||||
//!
|
||||
//! ```
|
||||
//! # #![feature(async_await)]
|
||||
//! # fn main() { async_std::task::block_on(async {
|
||||
//! #
|
||||
//! use std::sync::Arc;
|
||||
|
|
|
@ -24,7 +24,6 @@ const BLOCKED: usize = 1 << 1;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use std::sync::Arc;
|
||||
|
@ -83,7 +82,6 @@ impl<T> Mutex<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use std::sync::Arc;
|
||||
|
@ -198,7 +196,6 @@ impl<T> Mutex<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use std::sync::Arc;
|
||||
|
@ -252,7 +249,6 @@ impl<T> Mutex<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::sync::Mutex;
|
||||
|
|
|
@ -33,7 +33,6 @@ const READ_COUNT_MASK: usize = !(ONE_READ - 1);
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::sync::RwLock;
|
||||
|
@ -90,7 +89,6 @@ impl<T> RwLock<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::sync::RwLock;
|
||||
|
@ -213,7 +211,6 @@ impl<T> RwLock<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::sync::RwLock;
|
||||
|
@ -256,7 +253,6 @@ impl<T> RwLock<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::sync::RwLock;
|
||||
|
@ -378,7 +374,6 @@ impl<T> RwLock<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::sync::RwLock;
|
||||
|
@ -419,7 +414,6 @@ impl<T> RwLock<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// use async_std::sync::RwLock;
|
||||
///
|
||||
/// let lock = RwLock::new(10);
|
||||
|
@ -437,7 +431,6 @@ impl<T> RwLock<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::sync::RwLock;
|
||||
|
|
|
@ -20,7 +20,6 @@ use super::pool;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// #
|
||||
/// use std::cell::Cell;
|
||||
///
|
||||
|
@ -92,7 +91,6 @@ impl<T: Send + 'static> LocalKey<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// #
|
||||
/// use std::cell::Cell;
|
||||
///
|
||||
|
@ -132,7 +130,6 @@ impl<T: Send + 'static> LocalKey<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// #
|
||||
/// use std::cell::Cell;
|
||||
///
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
//! Spawn a task and await its result:
|
||||
//!
|
||||
//! ```
|
||||
//! # #![feature(async_await)]
|
||||
//! # fn main() { async_std::task::block_on(async {
|
||||
//! #
|
||||
//! use async_std::task;
|
||||
|
|
|
@ -29,7 +29,6 @@ use crate::io;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::task;
|
||||
|
@ -51,7 +50,6 @@ pub fn current() -> Task {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::task;
|
||||
|
@ -83,7 +81,6 @@ where
|
|||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![feature(async_await)]
|
||||
/// use async_std::task;
|
||||
///
|
||||
/// fn main() {
|
||||
|
|
|
@ -14,7 +14,6 @@ use crate::io;
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use std::time::Duration;
|
||||
|
|
|
@ -65,7 +65,6 @@ impl<T> JoinHandle<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use async_std::task;
|
||||
|
@ -98,7 +97,6 @@ impl<T> Future for JoinHandle<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(async_await)]
|
||||
/// #
|
||||
/// use async_std::task;
|
||||
///
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(async_await)]
|
||||
|
||||
use async_std::task;
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(async_await)]
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use async_std::prelude::*;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(async_await)]
|
||||
|
||||
use std::cell::Cell;
|
||||
use std::num::Wrapping;
|
||||
use std::pin::Pin;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(async_await)]
|
||||
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
|
||||
use async_std::task;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(async_await)]
|
||||
|
||||
use async_std::io;
|
||||
use async_std::net::{TcpListener, TcpStream};
|
||||
use async_std::prelude::*;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(async_await)]
|
||||
|
||||
use async_std::io;
|
||||
use async_std::net::UdpSocket;
|
||||
use async_std::task;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#![cfg(unix)]
|
||||
#![feature(async_await)]
|
||||
|
||||
use async_std::io;
|
||||
use async_std::os::unix::net::UnixDatagram;
|
||||
|
|
Loading…
Reference in a new issue