From 5f30b98021bc26512086812d98f9b2f9d53710ed Mon Sep 17 00:00:00 2001 From: sharpened-nacho <166434451+sharpened-nacho@users.noreply.github.com> Date: Sun, 30 Jun 2024 17:18:27 +0200 Subject: [PATCH] stream: expose the streams gated by the time feature Added an export for the three last stream structures in the adapters mod. Timeout was already exposed in tokio_stream directly due to #4601 ; left it there. Fixes: #6656 --- tokio-stream/src/lib.rs | 3 +++ tokio-stream/src/stream_ext.rs | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tokio-stream/src/lib.rs b/tokio-stream/src/lib.rs index ff465ddb92e..edc7e87df20 100644 --- a/tokio-stream/src/lib.rs +++ b/tokio-stream/src/lib.rs @@ -88,6 +88,9 @@ pub mod adapters { AllFuture, AnyFuture, Chain, Filter, FilterMap, FoldFuture, Fuse, Map, MapWhile, Merge, Next, Peekable, Skip, SkipWhile, Take, TakeWhile, Then, TryNext, }; + cfg_time! { + pub use crate::stream_ext::{ChunksTimeout, Timeout, TimeoutRepeating}; + } } cfg_time! { diff --git a/tokio-stream/src/stream_ext.rs b/tokio-stream/src/stream_ext.rs index e66d3e67c4d..5511c1adc8a 100644 --- a/tokio-stream/src/stream_ext.rs +++ b/tokio-stream/src/stream_ext.rs @@ -61,13 +61,13 @@ pub use peekable::Peekable; cfg_time! { pub(crate) mod timeout; pub(crate) mod timeout_repeating; - use timeout::Timeout; - use timeout_repeating::TimeoutRepeating; + pub use timeout::Timeout; + pub use timeout_repeating::TimeoutRepeating; use tokio::time::{Duration, Interval}; mod throttle; use throttle::{throttle, Throttle}; mod chunks_timeout; - use chunks_timeout::ChunksTimeout; + pub use chunks_timeout::ChunksTimeout; } /// An extension trait for the [`Stream`] trait that provides a variety of