chore(key-pool): expose inner storage and client
This commit is contained in:
parent
8bfa1b8ac3
commit
c8bdcc81c4
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -2329,7 +2329,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "torn-key-pool"
|
||||
version = "1.1.2"
|
||||
version = "1.1.3"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"futures",
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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<S>
|
||||
pub struct KeyPoolInner<S>
|
||||
where
|
||||
S: KeyPoolStorage,
|
||||
{
|
||||
|
@ -473,6 +473,16 @@ where
|
|||
inner: Arc<KeyPoolInner<S>>,
|
||||
}
|
||||
|
||||
impl<S> Deref for KeyPool<S>
|
||||
where
|
||||
S: KeyPoolStorage,
|
||||
{
|
||||
type Target = KeyPoolInner<S>;
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.inner
|
||||
}
|
||||
}
|
||||
|
||||
enum RequestResult {
|
||||
Response(ApiResponse),
|
||||
Retry,
|
||||
|
|
Loading…
Reference in a new issue