feat: builder with shared configuration
Sometimes one might want to share the config to the builder api like one can to the connector api itself, allowing some optimization.
Since the config eventually get's Arc-d anyways there can be no disadvantage to this.
If htis is for reqwest, not sure this still make sense if it wants to just set its own fully-configured ClientConfig? This seems like a pretty niche use case and I'm not sure this is the best way to cover it.
It wants to set it's own fully configured ClientConfig but already holds an Arc-shared reference, hence this PR.
I can imagine other clients may like this as well.
Updated to have pub fn with_tls_config(self, config: impl Into<Arc<ClientConfig>>) ...
Why does it hold an Arc-shared reference? I don't like the use of Arc::make_mut() here -- it seems weird to me to want to use the HttpConnectorBuilder for a ClientConfig that is already "shrinkwrapped" in Arc.
Why does it hold an
Arc-shared reference?
I'll have to spend more time in the codebase to answer that in an exact way - I don't know offhand, if I had to guess from past experience with Surf then connection pooling seems like a likely reason.
I could change this to use Arc::get_mut if you like, which could possibly be a better way of doing things?