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

Join (and other stream types) should implement Stream #7

Open
zeenix opened this issue Dec 24, 2022 · 2 comments
Open

Join (and other stream types) should implement Stream #7

zeenix opened this issue Dec 24, 2022 · 2 comments

Comments

@zeenix
Copy link
Collaborator

zeenix commented Dec 24, 2022

I was very surprised when I tried to call poll_next on Pin<&mut Join> and compiler told me there is no such method. Seems like an oversight?

@danieldg
Copy link
Owner

danieldg commented Feb 5, 2023

The primary reason why the adapters don't impl futures::Stream: if they did, then if both the OrderedStreamExt and FuturesExt traits were in scope, the call join.next() would be ambiguous. This is particularly important for adapters like map. In addition, the choice of exactly what to return from the stream might be ambiguous (that's why into_stream and into_tuple_stream both exist).

@zeenix
Copy link
Collaborator Author

zeenix commented Feb 5, 2023

The primary reason why the adapters don't impl futures::Stream: if they did, then if both the OrderedStreamExt and FuturesExt traits were in scope, the call join.next() would be ambiguous.

There is an easy around around that but if this crate wanted to avoid this, OrderedStreamExt::next should have been named differently then.

that's why into_stream and into_tuple_stream both exist).

I guess that's good enough.

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

No branches or pull requests

2 participants