From 76ec9c45638231127fd63e7279bd3c1be1430cfd Mon Sep 17 00:00:00 2001 From: yjhmelody <465402634@qq.com> Date: Fri, 15 Nov 2019 14:33:34 +0800 Subject: [PATCH 1/2] update doc url --- docs/src/overview/std-and-library-futures.md | 6 +++--- src/io/buf_read/mod.rs | 2 +- src/io/read/mod.rs | 2 +- src/io/seek/mod.rs | 2 +- src/io/write/mod.rs | 2 +- src/net/tcp/stream.rs | 6 +++--- src/stream/stream/mod.rs | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/src/overview/std-and-library-futures.md b/docs/src/overview/std-and-library-futures.md index 5c5f96f..9b4801e 100644 --- a/docs/src/overview/std-and-library-futures.md +++ b/docs/src/overview/std-and-library-futures.md @@ -4,11 +4,11 @@ Rust has two kinds of types commonly referred to as `Future`: - the first is `std::future::Future` from Rust’s [standard library](https://doc.rust-lang.org/std/future/trait.Future.html). -- the second is `futures::future::Future` from the [futures-rs crate](https://docs.rs/futures-preview/0.3.0-alpha.17/futures/prelude/trait.Future.html), currently released as `futures-preview`. +- the second is `futures::future::Future` from the [futures-rs crate](https://docs.rs/futures/0.3/futures/prelude/trait.Future.html). -The future defined in the [futures-rs](https://docs.rs/futures-preview/0.3.0-alpha.17/futures/prelude/trait.Future.html) crate was the original implementation of the type. To enable the `async/await` syntax, the core Future trait was moved into Rust’s standard library and became `std::future::Future`. In some sense, the `std::future::Future` can be seen as a minimal subset of `futures::future::Future`. +The future defined in the [futures-rs](https://docs.rs/futures/0.3/futures/prelude/trait.Future.html) crate was the original implementation of the type. To enable the `async/await` syntax, the core Future trait was moved into Rust’s standard library and became `std::future::Future`. In some sense, the `std::future::Future` can be seen as a minimal subset of `futures::future::Future`. -It is critical to understand the difference between `std::future::Future` and `futures::future::Future`, and the approach that `async-std` takes towards them. In itself, `std::future::Future` is not something you want to interact with as a user—except by calling `.await` on it. The inner workings of `std::future::Future` are mostly of interest to people implementing `Future`. Make no mistake—this is very useful! Most of the functionality that used to be defined on `Future` itself has been moved to an extension trait called [`FuturesExt`](https://docs.rs/futures-preview/0.3.0-alpha.17/futures/future/trait.FutureExt.html). From this information, you might be able to infer that the `futures` library serves as an extension to the core Rust async features. +It is critical to understand the difference between `std::future::Future` and `futures::future::Future`, and the approach that `async-std` takes towards them. In itself, `std::future::Future` is not something you want to interact with as a user—except by calling `.await` on it. The inner workings of `std::future::Future` are mostly of interest to people implementing `Future`. Make no mistake—this is very useful! Most of the functionality that used to be defined on `Future` itself has been moved to an extension trait called [`FuturesExt`](https://docs.rs/futures/0.3/futures/future/trait.FutureExt.html). From this information, you might be able to infer that the `futures` library serves as an extension to the core Rust async features. In the same tradition as `futures`, `async-std` re-exports the core `std::future::Future` type. You can actively opt into the extensions provided by the `futures-preview` crate by adding it to your `Cargo.toml` and importing `FuturesExt`. diff --git a/src/io/buf_read/mod.rs b/src/io/buf_read/mod.rs index 45c5f28..d919a78 100644 --- a/src/io/buf_read/mod.rs +++ b/src/io/buf_read/mod.rs @@ -34,7 +34,7 @@ extension_trait! { [`std::io::BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html [`futures::io::AsyncBufRead`]: - https://docs.rs/futures-preview/0.3.0-alpha.17/futures/io/trait.AsyncBufRead.html + https://docs.rs/futures/0.3/futures/io/trait.AsyncBufRead.html [provided methods]: #provided-methods [`BufReadExt`]: ../io/prelude/trait.BufReadExt.html [prelude]: ../prelude/index.html diff --git a/src/io/read/mod.rs b/src/io/read/mod.rs index 56f6323..0d7f4dc 100644 --- a/src/io/read/mod.rs +++ b/src/io/read/mod.rs @@ -40,7 +40,7 @@ extension_trait! { [`std::io::Read`]: https://doc.rust-lang.org/std/io/trait.Read.html [`futures::io::AsyncRead`]: - https://docs.rs/futures-preview/0.3.0-alpha.17/futures/io/trait.AsyncRead.html + https://docs.rs/futures/0.3/futures/io/trait.AsyncRead.html [`poll_read`]: #tymethod.poll_read [`poll_read_vectored`]: #method.poll_read_vectored [`ReadExt`]: ../io/prelude/trait.ReadExt.html diff --git a/src/io/seek/mod.rs b/src/io/seek/mod.rs index 7dc30ae..e97cabe 100644 --- a/src/io/seek/mod.rs +++ b/src/io/seek/mod.rs @@ -27,7 +27,7 @@ extension_trait! { [`std::io::Seek`]: https://doc.rust-lang.org/std/io/trait.Seek.html [`futures::io::AsyncSeek`]: - https://docs.rs/futures-preview/0.3.0-alpha.17/futures/io/trait.AsyncSeek.html + https://docs.rs/futures/0.3/futures/stream/trait.Stream.html [provided methods]: #provided-methods [`SeekExt`]: ../io/prelude/trait.SeekExt.html [prelude]: ../prelude/index.html diff --git a/src/io/write/mod.rs b/src/io/write/mod.rs index eb11434..0ed91dd 100644 --- a/src/io/write/mod.rs +++ b/src/io/write/mod.rs @@ -35,7 +35,7 @@ extension_trait! { [`std::io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html [`futures::io::AsyncWrite`]: - https://docs.rs/futures-preview/0.3.0-alpha.17/futures/io/trait.AsyncWrite.html + https://docs.rs/futures/0.3/futures/io/trait.AsyncWrite.html [`poll_write`]: #tymethod.poll_write [`poll_write_vectored`]: #method.poll_write_vectored [`poll_flush`]: #tymethod.poll_flush diff --git a/src/net/tcp/stream.rs b/src/net/tcp/stream.rs index 13a1752..1da9c7c 100644 --- a/src/net/tcp/stream.rs +++ b/src/net/tcp/stream.rs @@ -22,9 +22,9 @@ use crate::task::{spawn_blocking, Context, Poll}; /// [`connect`]: struct.TcpStream.html#method.connect /// [accepting]: struct.TcpListener.html#method.accept /// [listener]: struct.TcpListener.html -/// [`AsyncRead`]: https://docs.rs/futures-preview/0.3.0-alpha.17/futures/io/trait.AsyncRead.html -/// [`AsyncWrite`]: https://docs.rs/futures-preview/0.3.0-alpha.17/futures/io/trait.AsyncWrite.html -/// [`futures::io`]: https://docs.rs/futures-preview/0.3.0-alpha.17/futures/io/index.html +/// [`AsyncRead`]: https://docs.rs/futures/0.3/futures/io/trait.AsyncRead.html +/// [`AsyncWrite`]: https://docs.rs/futures/0.3/futures/io/trait.AsyncWrite.html +/// [`futures::io`]: https://docs.rs/futures/0.3/futures/io/index.html /// [`shutdown`]: struct.TcpStream.html#method.shutdown /// [`std::net::TcpStream`]: https://doc.rust-lang.org/std/net/struct.TcpStream.html /// diff --git a/src/stream/stream/mod.rs b/src/stream/stream/mod.rs index 281e4d8..de5eb38 100644 --- a/src/stream/stream/mod.rs +++ b/src/stream/stream/mod.rs @@ -157,7 +157,7 @@ extension_trait! { [`std::iter::Iterator`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html [`futures::stream::Stream`]: - https://docs.rs/futures-preview/0.3.0-alpha.17/futures/stream/trait.Stream.html + https://docs.rs/futures/0.3/futures/stream/trait.Stream.html [provided methods]: #provided-methods [`StreamExt`]: ../prelude/trait.StreamExt.html [prelude]: ../prelude/index.html From 74caed2d4bcf6097c798d96d424c8d217fd520ce Mon Sep 17 00:00:00 2001 From: yjh Date: Fri, 15 Nov 2019 18:22:06 +0800 Subject: [PATCH 2/2] Update src/io/seek/mod.rs Co-Authored-By: Taiki Endo --- src/io/seek/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/io/seek/mod.rs b/src/io/seek/mod.rs index e97cabe..f565ca4 100644 --- a/src/io/seek/mod.rs +++ b/src/io/seek/mod.rs @@ -27,7 +27,7 @@ extension_trait! { [`std::io::Seek`]: https://doc.rust-lang.org/std/io/trait.Seek.html [`futures::io::AsyncSeek`]: - https://docs.rs/futures/0.3/futures/stream/trait.Stream.html + https://docs.rs/futures/0.3/futures/io/trait.AsyncSeek.html [provided methods]: #provided-methods [`SeekExt`]: ../io/prelude/trait.SeekExt.html [prelude]: ../prelude/index.html