As explained in the Reqwest::Client documentation, it's always preferable to be able to create a client and reuse it. In theory, since my application already uses a Reqwest::Client, I should be able to reuse it with tmdb_api.
There won't have issue with ownership, since Reqwest::Client already embeds an Arc, so cloning the client allows it to be reused without worry.
I'm planning to propose a PR to add the with_http_client(api_key: String, client: reqwest::Client) constructor to tmdb_api::client::Client, along the lines of the Vec::with_capacity constructor.
Let me know if this works for you?
As explained in the
Reqwest::Client
documentation, it's always preferable to be able to create a client and reuse it. In theory, since my application already uses aReqwest::Client
, I should be able to reuse it with tmdb_api.There won't have issue with ownership, since
Reqwest::Client
already embeds anArc
, so cloning the client allows it to be reused without worry.I'm planning to propose a PR to add the
with_http_client(api_key: String, client: reqwest::Client)
constructor totmdb_api::client::Client
, along the lines of theVec::with_capacity
constructor. Let me know if this works for you?