From fd3d80478d36b92b05a25769a74d8a06a88ec6a0 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Mon, 13 Apr 2020 00:03:17 +0200 Subject: [PATCH 1/6] doc: unlink `driver` in `tokio::runtime` This is a deadlink, because `driver` mod is pub(crate). --- tokio/src/runtime/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tokio/src/runtime/mod.rs b/tokio/src/runtime/mod.rs index 36b2b442ee1..5166745711e 100644 --- a/tokio/src/runtime/mod.rs +++ b/tokio/src/runtime/mod.rs @@ -245,7 +245,7 @@ use std::time::Duration; /// The Tokio runtime. /// -/// The runtime provides an I/O [driver], task scheduler, [timer], and blocking +/// The runtime provides an I/O driver, task scheduler, [timer], and blocking /// pool, necessary for running asynchronous tasks. /// /// Instances of `Runtime` can be created using [`new`] or [`Builder`]. However, @@ -266,7 +266,6 @@ use std::time::Duration; /// that reactor will no longer function. Calling any method on them will /// result in an error. /// -/// [driver]: crate::io::driver /// [timer]: crate::time /// [mod]: index.html /// [`new`]: #method.new From d502591c8ab56b2f018ddf05bc42e0cfcc1c98bd Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Mon, 13 Apr 2020 10:15:17 +0200 Subject: [PATCH 2/6] doc: fix link for TcpStream --- tokio/src/net/tcp/listener.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio/src/net/tcp/listener.rs b/tokio/src/net/tcp/listener.rs index cde22cb636f..aa2ffcf280f 100644 --- a/tokio/src/net/tcp/listener.rs +++ b/tokio/src/net/tcp/listener.rs @@ -135,7 +135,7 @@ impl TcpListener { /// established, the corresponding [`TcpStream`] and the remote peer's /// address will be returned. /// - /// [`TcpStream`]: ../struct.TcpStream.html + /// [`TcpStream`]: struct@crate::net::TcpStream /// /// # Examples /// From 1262fa423dd429aa8822ecf976aed9e199e17a5e Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Mon, 13 Apr 2020 10:44:04 +0200 Subject: [PATCH 3/6] doc: fix Runtime::block_on method --- tokio/src/task/local.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tokio/src/task/local.rs b/tokio/src/task/local.rs index 551362a13f8..d06745ec5df 100644 --- a/tokio/src/task/local.rs +++ b/tokio/src/task/local.rs @@ -106,7 +106,7 @@ cfg_rt_util! { /// /// [`Send`]: https://doc.rust-lang.org/std/marker/trait.Send.html /// [local task set]: struct@LocalSet - /// [`Runtime::block_on`]: ../struct.Runtime.html#method.block_on + /// [`Runtime::block_on`]: method@crate::runtime::Runtime::block_on /// [`task::spawn_local`]: fn@spawn_local pub struct LocalSet { /// Current scheduler tick @@ -336,7 +336,7 @@ impl LocalSet { /// ``` /// /// [`spawn_local`]: fn@spawn_local - /// [`Runtime::block_on`]: ../struct.Runtime.html#method.block_on + /// [`Runtime::block_on`]: method@crate::runtime::Runtime::block_on /// [in-place blocking]: ../blocking/fn.in_place.html /// [`spawn_blocking`]: ../blocking/fn.spawn_blocking.html pub fn block_on(&self, rt: &mut crate::runtime::Runtime, future: F) -> F::Output From 1554330d5acd5d3ba62ab937f9542f9c1a8a7d54 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Mon, 13 Apr 2020 10:57:50 +0200 Subject: [PATCH 4/6] doc: fix link for spawn_blocking --- tokio/src/task/local.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio/src/task/local.rs b/tokio/src/task/local.rs index d06745ec5df..c5ac25fafa5 100644 --- a/tokio/src/task/local.rs +++ b/tokio/src/task/local.rs @@ -338,7 +338,7 @@ impl LocalSet { /// [`spawn_local`]: fn@spawn_local /// [`Runtime::block_on`]: method@crate::runtime::Runtime::block_on /// [in-place blocking]: ../blocking/fn.in_place.html - /// [`spawn_blocking`]: ../blocking/fn.spawn_blocking.html + /// [`spawn_blocking`]: fn@crate::task::spawn_blocking pub fn block_on(&self, rt: &mut crate::runtime::Runtime, future: F) -> F::Output where F: Future, From 3f46ba74d653cac5838402bb172c0cd63d60c705 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Mon, 13 Apr 2020 12:35:48 +0200 Subject: [PATCH 5/6] doc: fix link for in_place --- tokio/src/task/local.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio/src/task/local.rs b/tokio/src/task/local.rs index c5ac25fafa5..f9b61069a06 100644 --- a/tokio/src/task/local.rs +++ b/tokio/src/task/local.rs @@ -337,7 +337,7 @@ impl LocalSet { /// /// [`spawn_local`]: fn@spawn_local /// [`Runtime::block_on`]: method@crate::runtime::Runtime::block_on - /// [in-place blocking]: ../blocking/fn.in_place.html + /// [in-place blocking]: fn@crate::task::block_in_place /// [`spawn_blocking`]: fn@crate::task::spawn_blocking pub fn block_on(&self, rt: &mut crate::runtime::Runtime, future: F) -> F::Output where From e19a0d4fb183eea5259291ce5f3bf7061ab05af8 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Mon, 13 Apr 2020 14:23:32 +0200 Subject: [PATCH 6/6] doc: Remove Timer reference from DelayQueue's docs --- tokio/src/time/delay_queue.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tokio/src/time/delay_queue.rs b/tokio/src/time/delay_queue.rs index 59f901a95d5..989b42e81d9 100644 --- a/tokio/src/time/delay_queue.rs +++ b/tokio/src/time/delay_queue.rs @@ -50,13 +50,12 @@ use std::task::{self, Poll}; /// /// # Implementation /// -/// The `DelayQueue` is backed by the same hashed timing wheel implementation as -/// [`Timer`] as such, it offers the same performance benefits. See [`Timer`] -/// for further implementation notes. +/// The [`DelayQueue`] is backed by a separate instance of the same timer wheel used internally by +/// Tokio's standalone timer utilities such as [`delay_for`]. Because of this, it offers the same +/// performance and scalability benefits. /// -/// State associated with each entry is stored in a [`slab`]. This allows -/// amortizing the cost of allocation. Space created for expired entries is -/// reused when inserting new entries. +/// State associated with each entry is stored in a [`slab`]. This amortizes the cost of allocation, +/// and allows reuse of the memory allocated for expired entires. /// /// Capacity can be checked using [`capacity`] and allocated preemptively by using /// the [`reserve`] method. @@ -118,7 +117,8 @@ use std::task::{self, Poll}; /// [`Stream`]: https://docs.rs/futures/0.1/futures/stream/trait.Stream.html /// [`poll`]: #method.poll /// [`Stream::poll`]: #method.poll -/// [`Timer`]: ../struct.Timer.html +/// [`DelayQueue`]: struct@DelayQueue +/// [`delay_for`]: fn@super::delay_for /// [`slab`]: https://docs.rs/slab /// [`capacity`]: #method.capacity /// [`reserve`]: #method.reserve