summaryrefslogtreecommitdiffstats
path: root/futures
diff options
context:
space:
mode:
Diffstat (limited to 'futures')
-rw-r--r--futures/src/runtime.rs5
-rw-r--r--futures/src/subscription.rs6
-rw-r--r--futures/src/subscription/tracker.rs3
3 files changed, 8 insertions, 6 deletions
diff --git a/futures/src/runtime.rs b/futures/src/runtime.rs
index 2241a494..16111b36 100644
--- a/futures/src/runtime.rs
+++ b/futures/src/runtime.rs
@@ -9,9 +9,9 @@ use std::marker::PhantomData;
/// A batteries-included runtime of commands and subscriptions.
///
/// If you have an [`Executor`], a [`Runtime`] can be leveraged to run any
-/// [`Command`] or [`Subscription`] and get notified of the results!
+/// `Command` or [`Subscription`] and get notified of the results!
///
-/// [`Command`]: crate::Command
+/// [`Subscription`]: crate::Subscription
#[derive(Debug)]
pub struct Runtime<Executor, Sender, Message> {
executor: Executor,
@@ -75,6 +75,7 @@ where
/// [`Tracker::update`] to learn more about this!
///
/// [`Tracker::update`]: subscription::Tracker::update
+ /// [`Subscription`]: crate::Subscription
pub fn track(
&mut self,
recipes: impl IntoIterator<
diff --git a/futures/src/subscription.rs b/futures/src/subscription.rs
index 759dd223..d40125e3 100644
--- a/futures/src/subscription.rs
+++ b/futures/src/subscription.rs
@@ -19,16 +19,14 @@ pub type EventStream = BoxStream<(Event, event::Status)>;
/// A request to listen to external events.
///
-/// Besides performing async actions on demand with [`Command`], most
+/// Besides performing async actions on demand with `Command`, most
/// applications also need to listen to external events passively.
///
-/// A [`Subscription`] is normally provided to some runtime, like a [`Command`],
+/// A [`Subscription`] is normally provided to some runtime, like a `Command`,
/// and it will generate events as long as the user keeps requesting it.
///
/// For instance, you can use a [`Subscription`] to listen to a WebSocket
/// connection, keyboard presses, mouse events, time ticks, etc.
-///
-/// [`Command`]: crate::Command
#[must_use = "`Subscription` must be returned to runtime to take effect"]
pub struct Subscription<Message> {
recipes: Vec<Box<dyn Recipe<Output = Message>>>,
diff --git a/futures/src/subscription/tracker.rs b/futures/src/subscription/tracker.rs
index ae71cd25..3a83da09 100644
--- a/futures/src/subscription/tracker.rs
+++ b/futures/src/subscription/tracker.rs
@@ -14,6 +14,8 @@ use std::hash::Hasher as _;
/// If you have an application that continuously returns a [`Subscription`],
/// you can use a [`Tracker`] to keep track of the different recipes and keep
/// its executions alive.
+///
+/// [`Subscription`]: crate::Subscription
#[derive(Debug, Default)]
pub struct Tracker {
subscriptions: HashMap<u64, Execution>,
@@ -51,6 +53,7 @@ impl Tracker {
/// the [`Tracker`] changes.
///
/// [`Recipe`]: crate::subscription::Recipe
+ /// [`Subscription`]: crate::Subscription
pub fn update<Message, Receiver>(
&mut self,
recipes: impl Iterator<Item = Box<dyn Recipe<Output = Message>>>,