nats.rs
nats.rs copied to clipboard
ConnectOptions do not implement Clone
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.
+1 for this!