From 7c7386735ef013f29a72cea801689a71e3db74ac Mon Sep 17 00:00:00 2001 From: Wouter Geraedts Date: Tue, 12 Nov 2019 14:34:31 +0100 Subject: [PATCH 1/2] Wrap around throttle comment Co-Authored-By: Yoshua Wuyts --- src/stream/stream/throttle.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/stream/stream/throttle.rs b/src/stream/stream/throttle.rs index 8813607..44ce7e1 100644 --- a/src/stream/stream/throttle.rs +++ b/src/stream/stream/throttle.rs @@ -9,7 +9,13 @@ use crate::stream::Stream; use crate::task::{Context, Poll}; pin_project! { - /// A stream that only yields one element once every `duration`, and applies backpressure. Does not drop any elements. + /// A stream that only yields one element once every `duration`. + /// + /// This `struct` is created by the [`throttle`] method on [`Stream`]. See its + /// documentation for more. + /// + /// [`throttle`]: trait.Stream.html#method.throttle + /// [`Stream`]: trait.Stream.html #[doc(hidden)] #[allow(missing_debug_implementations)] pub struct Throttle { From 6f6d5e9d205765a6676a08c74e00c3f6001da93e Mon Sep 17 00:00:00 2001 From: Wouter Geraedts Date: Tue, 12 Nov 2019 14:35:03 +0100 Subject: [PATCH 2/2] Updated throttle fn comments. Co-Authored-By: Yoshua Wuyts --- src/stream/stream/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stream/stream/mod.rs b/src/stream/stream/mod.rs index a91517d..6a6d43d 100644 --- a/src/stream/stream/mod.rs +++ b/src/stream/stream/mod.rs @@ -318,6 +318,7 @@ extension_trait! { #[doc = r#" Limit the amount of items yielded per timeslice in a stream. +This stream does not drop any items, but will only limit the rate at which items pass through. # Examples ```ignore # fn main() { async_std::task::block_on(async {