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

Add type alias BoxFusedStream #2186

Closed
wants to merge 1 commit into from

Conversation

mzabaluev
Copy link
Contributor

Like BoxStream, this can be used for convenience.
Unlike BoxStream, the type is usable directly in select!.
Also add LocalBoxFusedStream.

Like BoxStream, this can be used for convenience.
Also add LocalBoxFusedStream.
Copy link
Member

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.
I would prefer not to expose more (Local)Boxed* type aliases. If we accept this PR, we will probably also need (Local)BoxedFusedFuture for consistency. And the same can happen if new stream related traits are added.

@mzabaluev
Copy link
Contributor Author

The case for these aliases is to facilitate direct use of boxed futures/streams in select!, using the fuse logic that is provided by the boxed future through dynamic dispatch.

I would not advocate proliferation of arbitrary boxed trait aliases for the sake of convenience alone.

@taiki-e
Copy link
Member

taiki-e commented Dec 8, 2020

Sorry for the delayed reply.

I'm considering removing Fused* traits in the next major version (#2207) (also it may be deprecated in the current major version).
Also, it is difficult to implement Fused* traits correctly without specialization, so I personally do not recommend relying on those implementations.
So I recommended using Fuse<BoxedFuture<..>> or defining your own type alias, instead of improving convenience for features that will be deprecated.

I'm going to close this, but thanks @mzabaluev for the patch anyway.

@taiki-e taiki-e closed this Dec 8, 2020
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

Successfully merging this pull request may close these issues.

2 participants