diff --git a/src/clients/hyper_client.rs b/src/clients/hyper_client.rs index dfdd16c1..3f4c0fd7 100644 --- a/src/clients/hyper_client.rs +++ b/src/clients/hyper_client.rs @@ -25,6 +25,13 @@ impl Default for HyperWebPushClient { } } +impl From>> for HyperWebPushClient { + /// Creates a new client from a custom hyper HTTP client. + fn from(client: Client>) -> Self { + Self { client } + } +} + impl HyperWebPushClient { /// Creates a new client. pub fn new() -> Self { diff --git a/src/clients/isahc_client.rs b/src/clients/isahc_client.rs index d4c67947..5b8dec2b 100644 --- a/src/clients/isahc_client.rs +++ b/src/clients/isahc_client.rs @@ -26,6 +26,13 @@ impl Default for IsahcWebPushClient { } } +impl From for IsahcWebPushClient { + /// Creates a new client from a custom Isahc HTTP client. + fn from(client: HttpClient) -> Self { + Self { client } + } +} + impl IsahcWebPushClient { /// Creates a new client. Can fail under resource depletion. pub fn new() -> Result {