tokio
tokio copied to clipboard
Making the Stream adaptor structures public in tokio-stream
Motivation
The StreamExt trait provides the helpful method take, map, and the like on Streams. But the structures themselves (Take, Map, etc.) are not visible outside the crate, as they are not pub use in stream_ext.rs.
Solution
Re-exported publicly all the structures in stream_ext.rs except for Collect, which is different and should not be exported as stated in its documentation. Re-exported them publicly again in lib.rs.
Added a function in a test with return type Chain to show that it can be part of an external function signature.
Closes: #6656
My bad again, sorry for pushing bad commits like those, I'm not familiar enough with large projects to understand how to run all tests. I hope you can squash all that mess together...
I just realized the equivalence between tokio_stream::StreamExt and futures_util::StreamExt. But in futures-util the structures are exported and accessible, so the functionality I needed is ultimately not needed here, I can get it from futures-util.
Do you want to roll back to the beginning and drop this PR?
Any idea when a new version of tokio-stream will be rolled with this in it? Thanks!
I don't have concrete plans for a release right now.
Releasing in #6825.