Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StreamExt is hard to find #2383

Open
jyn514 opened this issue Apr 2, 2021 · 3 comments
Open

StreamExt is hard to find #2383

jyn514 opened this issue Apr 2, 2021 · 3 comments
Labels

Comments

@jyn514
Copy link
Member

jyn514 commented Apr 2, 2021

This is more a user story than anything else. Say I have a Stream of futures and I want to do something with it. The first thing I did was go to https://docs.rs/futures/0.3.13/futures/, which links to https://docs.rs/futures/0.3.13/futures/stream/trait.Stream.html. Great, this looks like what I want! Then I look around on the page, and there's basically nothing there. poll_next looks complicated and low-level, and size_hint is not what I need. Then there's a very long list of "Implementors", which looks vaguely right, but I don't know which of them I need because they're not documented (presumably because I'm supposed to read the docs on StreamExt).

I figured this out by asking @Nemo157, but it would be nice to link directly there from the docs. I tried this originally, but it had no effect (probably because of rust-lang/rust#81893):

diff --git a/futures-util/src/stream/mod.rs b/futures-util/src/stream/mod.rs
index f3b2baa4..c613843b 100644
--- a/futures-util/src/stream/mod.rs
+++ b/futures-util/src/stream/mod.rs
@@ -11,7 +11,11 @@
 
 #[cfg(feature = "alloc")]
 pub use futures_core::stream::{BoxStream, LocalBoxStream};
-pub use futures_core::stream::{FusedStream, Stream, TryStream};
+pub use futures_core::stream::FusedStream;
+/// Most functions on this trait are implemented through [`StreamExt`].
+pub use futures_core::stream::Stream;
+/// Most functions on this trait are implemented through [`TryStreamExt`].
+pub use futures_core::stream::TryStream;
 
 // Extension traits and combinators
 
@taiki-e taiki-e added the docs label Apr 2, 2021
@taiki-e
Copy link
Member

taiki-e commented Apr 2, 2021

thanks. first, we need to link to module instead of trait, in top page. (like io, channel, executor, etc.). next, we need to improve module docs.

@jyn514
Copy link
Member Author

jyn514 commented Apr 2, 2021

first, we need to link to module instead of trait, in top page. (like io, channel, executor, etc.).

Sure, that could work.

next, we need to improve module docs (probably fine with copy of std).

That doesn't help with StreamExt though - the std docs never mention any of the extension traits.

@taiki-e
Copy link
Member

taiki-e commented Apr 2, 2021

That doesn't help with StreamExt though - the std docs never mention any of the extension traits.

you are right. copy of std is not enough, we need to add section or description for StreamExt and utils.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants