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]]
|
[[package]]
|
||||||
name = "torn-key-pool"
|
name = "torn-key-pool"
|
||||||
version = "1.1.2"
|
version = "1.1.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"futures",
|
"futures",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "torn-key-pool"
|
name = "torn-key-pool"
|
||||||
version = "1.1.2"
|
version = "1.1.3"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Pyrit [2111649]"]
|
authors = ["Pyrit [2111649]"]
|
||||||
license-file = { workspace = true }
|
license-file = { workspace = true }
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#[cfg(feature = "postgres")]
|
#[cfg(feature = "postgres")]
|
||||||
pub mod 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 futures::{future::BoxFuture, FutureExt, Stream, StreamExt};
|
||||||
use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION};
|
use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION};
|
||||||
|
@ -354,7 +354,7 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct KeyPoolInner<S>
|
pub struct KeyPoolInner<S>
|
||||||
where
|
where
|
||||||
S: KeyPoolStorage,
|
S: KeyPoolStorage,
|
||||||
{
|
{
|
||||||
|
@ -473,6 +473,16 @@ where
|
||||||
inner: Arc<KeyPoolInner<S>>,
|
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 {
|
enum RequestResult {
|
||||||
Response(ApiResponse),
|
Response(ApiResponse),
|
||||||
Retry,
|
Retry,
|
||||||
|
|
Loading…
Reference in a new issue