From 3ecc302097c8c25c56756cec6735a8b326481bfa Mon Sep 17 00:00:00 2001 From: TotallyNot <44345987+TotallyNot@users.noreply.github.com> Date: Wed, 31 Aug 2022 23:38:38 +0200 Subject: [PATCH] hack to make awc usable with key pool --- torn-key-pool/Cargo.toml | 2 +- torn-key-pool/src/lib.rs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/torn-key-pool/Cargo.toml b/torn-key-pool/Cargo.toml index 2a7de04..a3b521c 100644 --- a/torn-key-pool/Cargo.toml +++ b/torn-key-pool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "torn-key-pool" -version = "0.1.0" +version = "0.1.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/torn-key-pool/src/lib.rs b/torn-key-pool/src/lib.rs index d682735..912ac48 100644 --- a/torn-key-pool/src/lib.rs +++ b/torn-key-pool/src/lib.rs @@ -127,3 +127,13 @@ where KeyPoolExecutor::new(&self.client, &self.storage, domain) } } + +pub trait ApiClientExt: ApiClient { + fn with_pool<'a, S>(&'a self, domain: KeyDomain, storage: &'a S) -> KeyPoolExecutor + where + Self: Sized, + S: KeyPoolStorage, + { + KeyPoolExecutor::new(self, storage, domain) + } +}