chore(key-pool): expose inner storage and client

This commit is contained in:
pyrite 2025-05-27 19:27:58 +02:00
parent 8bfa1b8ac3
commit c8bdcc81c4
Signed by: pyrite
GPG key ID: 7F1BA9170CD35D15
3 changed files with 14 additions and 4 deletions

View file

@ -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,