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

ConnectOptions do not implement Clone #917

Open
matthiasbeyer opened this issue Apr 11, 2023 · 1 comment
Open

ConnectOptions do not implement Clone #917

matthiasbeyer opened this issue Apr 11, 2023 · 1 comment
Labels
enhancement Enhancement to existing functionality

Comments

@matthiasbeyer
Copy link
Contributor

Use Case:

In some instances it might be nice to have a Clone implementation for ConnectOptions.

Proposed Change:

Right now it seems possible, only the event_callback: CallbackArg1 member is an issue.

Who Benefits From The Change(s)?

In instances where the user of the crate uses a framework that does configuration construction in one step, and a later step is responsible for the connect() call.
If the user only has a nonmutable reference to the constructed ConnectOptions instance in that moment, they have to use some Arc/Mutex trickery to make their code work.

Alternative Approaches

Arc/Mutex trickery or "manual cloning" of a ConnectOptions instance.

@matthiasbeyer matthiasbeyer added the enhancement Enhancement to existing functionality label Apr 11, 2023
@esemeniuc
Copy link

+1 for this!

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

No branches or pull requests

2 participants