From bc3b49d52ed81a8b09ee49dc84fc97716fbbe49f Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Tue, 19 Sep 2023 14:52:43 +0200 Subject: [PATCH] Update docs --- tokio/src/sync/watch.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tokio/src/sync/watch.rs b/tokio/src/sync/watch.rs index dd6794c17f4..2b4fd561e96 100644 --- a/tokio/src/sync/watch.rs +++ b/tokio/src/sync/watch.rs @@ -645,6 +645,13 @@ impl Receiver { } /// Marks the state as changed. + /// + /// After invoking this method [`has_changed()`](Self::has_changed) + /// returns `true` and [`changed()`](Self::changed) returns + /// immediately, regardless of whether a new value has been sent. + /// + /// This is useful for triggering an initial change notification after + /// subscribing to synchronize new receivers. pub fn mark_changed(&mut self) { self.version.decrement(); }