Skip to content

Commit 7cf661b

Browse files
committed
Add VssClient::from_client_and_headers constructor
Previously, we'd allow to either re-use a `reqwest::Client` or supply a header provider. Here we add a new constructor that allows us to do both at the same time.
1 parent e6d8e57 commit 7cf661b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/client.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ impl VssClient {
3636
Self { base_url, client, header_provider: Arc::new(FixedHeaders::new(HashMap::new())) }
3737
}
3838

39+
/// Constructs a [`VssClient`] from a given [`reqwest::Client`], using `base_url` as the VSS server endpoint.
40+
///
41+
/// HTTP headers will be provided by the given `header_provider`.
42+
pub fn from_client_and_headers(
43+
base_url: String, client: Client, header_provider: Arc<dyn VssHeaderProvider>,
44+
) -> Self {
45+
Self { base_url, client, header_provider }
46+
}
47+
3948
/// Constructs a [`VssClient`] using `base_url` as the VSS server endpoint.
4049
///
4150
/// HTTP headers will be provided by the given `header_provider`.

0 commit comments

Comments
 (0)