From 4979635764da0ffefdfa7f9ff5070b23429d2e92 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 1 Apr 2020 00:24:43 +0200 Subject: Fix missing link in `Executor::enter` doc comment --- futures/src/executor.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'futures/src') diff --git a/futures/src/executor.rs b/futures/src/executor.rs index 5378c0b3..cbd34ee8 100644 --- a/futures/src/executor.rs +++ b/futures/src/executor.rs @@ -56,6 +56,8 @@ pub trait Executor: Sized { /// before creating futures. This method can be leveraged to set up this /// global state, call a function, restore the state, and obtain the result /// of the call. + /// + /// [`Executor`]: trait.Executor.html fn enter(&self, f: impl FnOnce() -> R) -> R { f() } -- cgit From 512dbd5076a7718077db81c1d3cb22d3a580b557 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 2 Apr 2020 02:26:23 +0200 Subject: Fix missing link in `Tracker::broadcast` docs --- futures/src/subscription/tracker.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'futures/src') diff --git a/futures/src/subscription/tracker.rs b/futures/src/subscription/tracker.rs index efb464b5..d5534296 100644 --- a/futures/src/subscription/tracker.rs +++ b/futures/src/subscription/tracker.rs @@ -131,6 +131,8 @@ where /// /// This method publishes the given event to all the subscription streams /// currently open. + /// + /// [`Recipe::stream`]: trait.Recipe.html#method.stream pub fn broadcast(&mut self, event: Event) { self.subscriptions .values_mut() -- cgit From e1e42f87bdccb21c8c27e88063abd87bbdd22832 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 2 Apr 2020 03:00:48 +0200 Subject: Add examples to `subscription::Recipe` docs --- futures/src/subscription.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'futures/src') diff --git a/futures/src/subscription.rs b/futures/src/subscription.rs index ab333a20..7a75fc31 100644 --- a/futures/src/subscription.rs +++ b/futures/src/subscription.rs @@ -142,6 +142,18 @@ impl std::fmt::Debug for Subscription { /// /// [`Subscription`]: struct.Subscription.html /// [`Recipe`]: trait.Recipe.html +/// +/// # Examples +/// The repository has a couple of [examples] that use a custom [`Recipe`]: +/// +/// - [`download_progress`], a basic application that asynchronously downloads +/// a dummy file of 100 MB and tracks the download progress. +/// - [`stopwatch`], a watch with start/stop and reset buttons showcasing how +/// to listen to time. +/// +/// [examples]: https://github.com/hecrj/iced/tree/0.1/examples +/// [`download_progress`]: https://github.com/hecrj/iced/tree/0.1/examples/download_progress +/// [`stopwatch`]: https://github.com/hecrj/iced/tree/0.1/examples/stopwatch pub trait Recipe { /// The events that will be produced by a [`Subscription`] with this /// [`Recipe`]. -- cgit From 0f745f0c140b69ec4925cf884f5bedb3a318b4fc Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 2 Apr 2020 03:48:29 +0200 Subject: Fix missing link in `Command` documentation --- futures/src/command.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'futures/src') diff --git a/futures/src/command.rs b/futures/src/command.rs index 535ae4f7..d4f99b82 100644 --- a/futures/src/command.rs +++ b/futures/src/command.rs @@ -7,6 +7,7 @@ use futures::future::{Future, FutureExt}; /// using the `From` trait or [`Command::perform`]. /// /// [`Command`]: struct.Command.html +/// [`Command::perform`]: #method.perform pub struct Command { futures: Vec>, } -- cgit From 743c8851d44773c517ab9627919436384cf6fa27 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 2 Apr 2020 03:50:39 +0200 Subject: Fix broken link in `Tracker::broadcast` docs --- futures/src/subscription/tracker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'futures/src') diff --git a/futures/src/subscription/tracker.rs b/futures/src/subscription/tracker.rs index d5534296..c2a0d0f1 100644 --- a/futures/src/subscription/tracker.rs +++ b/futures/src/subscription/tracker.rs @@ -132,7 +132,7 @@ where /// This method publishes the given event to all the subscription streams /// currently open. /// - /// [`Recipe::stream`]: trait.Recipe.html#method.stream + /// [`Recipe::stream`]: trait.Recipe.html#tymethod.stream pub fn broadcast(&mut self, event: Event) { self.subscriptions .values_mut() -- cgit