diff --git a/Cargo.lock b/Cargo.lock index 8687be0..42757e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2329,7 +2329,7 @@ dependencies = [ [[package]] name = "torn-key-pool" -version = "1.1.2" +version = "1.1.3" dependencies = [ "chrono", "futures", diff --git a/torn-key-pool/Cargo.toml b/torn-key-pool/Cargo.toml index 86881da..2164fd4 100644 --- a/torn-key-pool/Cargo.toml +++ b/torn-key-pool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "torn-key-pool" -version = "1.1.2" +version = "1.1.3" edition = "2021" authors = ["Pyrit [2111649]"] license-file = { workspace = true } diff --git a/torn-key-pool/src/lib.rs b/torn-key-pool/src/lib.rs index 2e41408..4f7d8cb 100644 --- a/torn-key-pool/src/lib.rs +++ b/torn-key-pool/src/lib.rs @@ -3,7 +3,7 @@ #[cfg(feature = "postgres")] pub mod postgres; -use std::{collections::HashMap, future::Future, sync::Arc, time::Duration}; +use std::{collections::HashMap, future::Future, ops::Deref, sync::Arc, time::Duration}; use futures::{future::BoxFuture, FutureExt, Stream, StreamExt}; use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION}; @@ -354,7 +354,7 @@ where } } -struct KeyPoolInner +pub struct KeyPoolInner where S: KeyPoolStorage, { @@ -473,6 +473,16 @@ where inner: Arc>, } +impl Deref for KeyPool +where + S: KeyPoolStorage, +{ + type Target = KeyPoolInner; + fn deref(&self) -> &Self::Target { + &self.inner + } +} + enum RequestResult { Response(ApiResponse), Retry,