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

Create DynamicSender from DynamicReceiver and vice versa. #3596

Open
Frostie314159 opened this issue Dec 1, 2024 · 2 comments
Open

Create DynamicSender from DynamicReceiver and vice versa. #3596

Frostie314159 opened this issue Dec 1, 2024 · 2 comments

Comments

@Frostie314159
Copy link
Contributor

Hi, for a rather specific use case, it would be nice to acquire a DynamicSender from a DynamicReceiver, since this would allow eliding a lot of generics. Is there anything preventing this, or a design choice speaking against this? If not, I would be happy to make a PR implementing that.

@Dirbaio
Copy link
Member

Dirbaio commented Dec 1, 2024

Having this feature would "feel wrong". It's nice to be able to rely on the fact that if you give some code a Receiver it can only receive, it can't magically convert that to a Sender and start sending into the channel.

@Frostie314159
Copy link
Contributor Author

Okay, that's my thought process too. Another option would be, to make a DynChannel, which exposes both methods. Maybe that's more idiomatic.

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