Skip to content

Commit 23097bf

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 6bdf104 commit 23097bf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/client.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ impl<R: RetryPolicy<E = VssError>> VssClient<R> {
4646
}
4747
}
4848

49+
/// Constructs a [`VssClient`] from a given [`reqwest::Client`], using `base_url` as the VSS server endpoint.
50+
///
51+
/// HTTP headers will be provided by the given `header_provider`.
52+
pub fn from_client_and_headers(
53+
base_url: String, client: Client, retry_policy: R,
54+
header_provider: Arc<dyn VssHeaderProvider>,
55+
) -> Self {
56+
Self { base_url, client, retry_policy, header_provider }
57+
}
58+
4959
/// Constructs a [`VssClient`] using `base_url` as the VSS server endpoint.
5060
///
5161
/// HTTP headers will be provided by the given `header_provider`.

0 commit comments

Comments
 (0)