Skip to content

Commit 9509a05

Browse files
committed
Merge branch 'master' into buf-writer
2 parents a0759a6 + f922e9c commit 9509a05

File tree

173 files changed

+7873
-3586
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+7873
-3586
lines changed

.travis.yml

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,66 @@ language: rust
33
env:
44
- RUSTFLAGS="-D warnings"
55

6-
before_script:
7-
- rustup component add rustfmt
6+
# Cache the whole `~/.cargo` directory to keep `~/cargo/.crates.toml`.
7+
cache:
8+
directories:
9+
- /home/travis/.cargo
10+
11+
# Don't cache the cargo registry because it's too big.
12+
before_cache:
13+
- rm -rf /home/travis/.cargo/registry
14+
15+
16+
branches:
17+
only:
18+
- master
19+
- staging
20+
- trying
821

922
matrix:
1023
fast_finish: true
1124
include:
1225
- rust: nightly
1326
os: linux
14-
env: BUILD_DOCS=1
27+
1528
- rust: nightly
1629
os: osx
1730
osx_image: xcode9.2
18-
env: BUILD_DOCS=1
31+
1932
- rust: nightly-x86_64-pc-windows-msvc
2033
os: windows
2134

35+
- name: fmt
36+
rust: nightly
37+
os: linux
38+
before_script: |
39+
if ! rustup component add rustfmt; then
40+
target=`curl https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/rustfmt`;
41+
echo "'rustfmt' is unavailable on the toolchain 'nightly', use the toolchain 'nightly-$target' instead";
42+
rustup toolchain install nightly-$target;
43+
rustup default nightly-$target;
44+
rustup component add rustfmt;
45+
fi
46+
script:
47+
- cargo fmt --all -- --check
48+
49+
- name: docs
50+
rust: nightly
51+
os: linux
52+
script:
53+
- cargo doc --features docs unstable
54+
55+
- name: book
56+
rust: nightly
57+
os: linux
58+
before_script:
59+
- test -x $HOME/.cargo/bin/mdbook || ./ci/install-mdbook.sh
60+
- cargo build # to find 'extern crate async_std' by `mdbook test`
61+
script:
62+
- mdbook build docs
63+
- mdbook test -L ./target/debug/deps docs
64+
2265
script:
2366
- cargo check --all --benches --bins --examples --tests
24-
- cargo test --all
25-
- cargo fmt --all -- --check
26-
- if [[ -n "$BUILD_DOCS" ]]; then cargo doc --features docs; fi
67+
- cargo check --features unstable --all --benches --bins --examples --tests
68+
- cargo test --all --doc --features unstable

CHANGELOG.md

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,89 @@
1-
# Version 0.99.3
1+
# Changelog
2+
3+
All notable changes to async-std will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://book.async.rs/overview/stability-guarantees.html).
7+
8+
## [Unreleased]
9+
10+
# [0.99.6] - 2019-09-19
11+
12+
## Added
13+
14+
- Added `stream::Stream::collect` as "unstable"
15+
- Added `stream::Stream::enumerate`
16+
- Added `stream::Stream::fuse`
17+
- Added `stream::Stream::fold`
18+
- Added `stream::Stream::scan`
19+
- Added `stream::Stream::zip`
20+
- Added `stream::join` macro as "unstable"
21+
- Added `stream::DoubleEndedStream` as "unstable"
22+
- Added `stream::FromStream` trait as "unstable"
23+
- Added `stream::IntoStream` trait as "unstable"
24+
- Added `io::Cursor` as "unstable"
25+
- Added `io::BufRead::consume` method
26+
- Added `io::repeat`
27+
- Added `io::Slice` and `io::SliceMut`
28+
- Added documentation for feature flags
29+
- Added `pin` submodule as "unstable"
30+
- Added the ability to `collect` a stream of `Result<T, E>`s into a
31+
`Result<impl FromStream<T>, E>`
32+
33+
## Changed
34+
35+
- Refactored the scheduling algorithm of our executor to use work stealing
36+
- Refactored the network driver, removing 400 lines of code
37+
- Removed the `Send` bound from `task::block_on`
38+
- Removed `Unpin` bound from `impl<T: futures::stream::Stream> Stream for T`
39+
40+
# [0.99.5] - 2019-09-12
41+
42+
## Added
43+
44+
- Added tests for `io::timeout`
45+
- Added `io::BufRead::fill_buf`, an `async fn` counterpart to `poll_fill_buf`
46+
- Added `fs::create_dir_all`
47+
- Added `future::timeout`, a free function to time out futures after a threshold
48+
- Added `io::prelude`
49+
- Added `net::ToSocketAddrs`, a non-blocking version of std's `ToSocketAddrs`
50+
- Added `stream::Stream::all`
51+
- Added `stream::Stream::filter_map`
52+
- Added `stream::Stream::find_map`
53+
- Added `stream::Stream::find`
54+
- Added `stream::Stream::min_by`
55+
- Added `stream::Stream::nth`
56+
57+
## Changed
58+
59+
- Polished the text and examples of the tutorial
60+
- `cargo fmt` on all examples
61+
- Simplified internals of `TcpStream::connect_to`
62+
- Modularized our CI setup, enabled a rustfmt fallback, and improved caching
63+
- Reduced our dependency on the `futures-rs` crate, improving compilation times
64+
- Split `io::Read`, `io::Write`, `io::BufRead`, and `stream::Stream` into
65+
multiple files
66+
- `fs::File` now flushes more often to prevent flushes during `seek`
67+
- Updated all dependencies
68+
- Fixed a bug in the conversion of `File` into raw handle
69+
- Fixed compilation errors on the latest nightly
70+
71+
## Removed
72+
73+
# [0.99.4] - 2019-08-21
74+
75+
## Changes
76+
77+
- Many small changes in the book, mostly typos
78+
- Documentation fixes correcting examples
79+
- Now works with recent nightly with stabilised async/await (> 2019-08-21)
80+
81+
# [0.99.3] - 2019-08-16
282

383
- Initial beta release
84+
85+
[Unreleased]: https://github.com/async-rs/async-std/compare/v0.99.6...HEAD
86+
[0.99.6]: https://github.com/async-rs/async-std/compare/v0.99.5...0.99.6
87+
[0.99.5]: https://github.com/async-rs/async-std/compare/v0.99.4...v0.99.5
88+
[0.99.4]: https://github.com/async-rs/async-std/compare/v0.99.3...v0.99.4
89+
[0.99.3]: https://github.com/async-rs/async-std/tree/v0.99.3

Cargo.toml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[package]
22
name = "async-std"
3-
version = "0.99.3"
3+
version = "0.99.6"
44
authors = [
55
"Stjepan Glavina <stjepang@gmail.com>",
6-
"The async-std Project Developers",
6+
"Yoshua Wuyts <yoshuawuyts@gmail.com>",
7+
"Contributors to async-std",
78
]
89
edition = "2018"
910
license = "Apache-2.0/MIT"
@@ -21,23 +22,36 @@ rustdoc-args = ["--cfg", "feature=\"docs\""]
2122

2223
[features]
2324
docs = []
25+
unstable = []
2426

2527
[dependencies]
28+
async-macros = "1.0.0"
2629
async-task = "1.0.0"
2730
cfg-if = "0.1.9"
2831
crossbeam-channel = "0.3.9"
29-
futures-preview = "0.3.0-alpha.17"
30-
futures-timer = "0.3.0"
31-
lazy_static = "1.3.0"
32+
crossbeam-deque = "0.7.1"
33+
futures-core-preview = "0.3.0-alpha.18"
34+
futures-io-preview = "0.3.0-alpha.18"
35+
futures-timer = "0.4.0"
36+
lazy_static = "1.4.0"
3237
log = { version = "0.4.8", features = ["kv_unstable"] }
3338
memchr = "2.2.1"
3439
mio = "0.6.19"
3540
mio-uds = "0.6.7"
36-
num_cpus = "1.10.0"
41+
num_cpus = "1.10.1"
3742
pin-utils = "0.1.0-alpha.4"
3843
slab = "0.4.2"
39-
surf = "1.0.1"
44+
kv-log-macro = "1.0.4"
4045

4146
[dev-dependencies]
42-
femme = "1.1.0"
47+
femme = "1.2.0"
48+
surf = "1.0.2"
4349
tempdir = "0.3.7"
50+
51+
# These are used by the book for examples
52+
futures-channel-preview = "0.3.0-alpha.18"
53+
futures-util-preview = "0.3.0-alpha.18"
54+
55+
[dev-dependencies.futures-preview]
56+
version = "0.3.0-alpha.18"
57+
features = ["std", "nightly", "async-await"]

README.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Async version of Rust's standard library
1+
# Async version of the Rust standard library
22

33
[![Build Status](https://travis-ci.com/async-rs/async-std.svg?branch=master)](https://travis-ci.com/async-rs/async-std)
44
[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](https://github.com/async-rs/async-std)
@@ -20,7 +20,7 @@ are used to, but in an async version and ready for Rust's `async`/`await` syntax
2020

2121
## Quickstart
2222

23-
Add the following lines to you `Cargo.toml`:
23+
Add the following lines to your `Cargo.toml`:
2424

2525
```toml
2626
[dependencies]
@@ -38,8 +38,6 @@ $ cargo add async-std
3838
## Hello world
3939

4040
```rust
41-
#![feature(async_await)]
42-
4341
use async_std::task;
4442

4543
fn main() {
@@ -52,8 +50,6 @@ fn main() {
5250
## Low-Friction Sockets with Built-In Timeouts
5351

5452
```rust
55-
#![feature(async_await)]
56-
5753
use std::time::Duration;
5854

5955
use async_std::{
@@ -70,9 +66,9 @@ async fn get() -> io::Result<Vec<u8>> {
7066
let mut buf = vec![];
7167

7268
io::timeout(Duration::from_secs(5), async {
73-
stream.read_to_end(&mut buf).await?
69+
stream.read_to_end(&mut buf).await?;
7470
Ok(buf)
75-
})
71+
}).await
7672
}
7773

7874
fn main() {
@@ -85,6 +81,25 @@ fn main() {
8581
}
8682
```
8783

84+
## Features
85+
86+
`async-std` is strongly commited to following semver. This means your code won't
87+
break unless _you_ decide to upgrade.
88+
89+
However every now and then we come up with something that we think will work
90+
_great_ for `async-std`, and we want to provide a sneak-peek so you can try it
91+
out. This is what we call _"unstable"_ features. You can try out the unstable
92+
features by enabling the `unstable` feature in your `Cargo.toml` file:
93+
94+
```toml
95+
[dependencies.async-std]
96+
version = "0.99"
97+
features = ["unstable"]
98+
```
99+
100+
Just be careful when using these features, as they may change between
101+
versions.
102+
88103
## Take a look around
89104

90105
Clone the repo:

benches/task_local.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(async_await, test)]
1+
#![feature(test)]
22

33
extern crate test;
44

bors.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
status = ["continuous-integration/travis-ci/push"]

ci/install-mdbook.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
set -euxo pipefail
2+
3+
# Based on the Rust-Embedded WG's book CI
4+
# https://github.com/rust-embedded/book/blob/master/ci/install.sh
5+
6+
main() {
7+
# Note - this will only accept releases tagged with v0.3.x
8+
local tag=$(git ls-remote --tags --refs --exit-code \
9+
https://github.com/rust-lang-nursery/mdbook \
10+
| cut -d/ -f3 \
11+
| grep -E '^v0\.3\.[0-9]+$' \
12+
| sort --version-sort \
13+
| tail -n1)
14+
15+
curl -LSfs https://japaric.github.io/trust/install.sh | \
16+
sh -s -- --git rust-lang-nursery/mdbook --tag $tag
17+
}
18+
19+
main

docs/src/concepts/data.csv

Whitespace-only changes.

0 commit comments

Comments
 (0)