We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d12746 commit 14cf135Copy full SHA for 14cf135
futures-util/src/stream/mod.rs
@@ -1068,7 +1068,10 @@ pub trait StreamExt: Stream {
1068
/// This future will drive the stream to keep producing items until it is
1069
/// exhausted, sending each item to the sink. It will complete once the
1070
/// stream is exhausted, the sink has received and flushed all items, and
1071
- /// the sink is closed.
+ /// the sink is closed. Note that neither the original stream nor provided
1072
+ /// sink will be output by this future. Pass the sink by `Pin<&mut S>`
1073
+ /// (for example, via `forward(&mut sink)` inside an `async` fn/block) in
1074
+ /// order to preserve access to the Sink.
1075
fn forward<S>(self, sink: S) -> Forward<Self, S>
1076
where
1077
S: Sink<<Self as TryStream>::Ok>,
0 commit comments