pub struct ProxyState {
pub pool: PgPool,
pub config: Arc<RwLock<ProxyConfig>>,
pub health_checker: Arc<HealthChecker>,
pub rate_limiter: Arc<RateLimiter>,
}Expand description
Proxy server state shared across handlers.
Fields§
§pool: PgPoolDatabase connection pool
config: Arc<RwLock<ProxyConfig>>Current proxy configuration
health_checker: Arc<HealthChecker>Health checker instance
rate_limiter: Arc<RateLimiter>Rate limiter instance.
Its cleanup task is not started here. vendored::ProxyService
starts it for the limiter it is given when it begins serving; a limiter
used anywhere else needs RateLimiter::start_cleanup spawned, or
the clients it has seen are never forgotten.
Implementations§
Source§impl ProxyState
impl ProxyState
Sourcepub async fn new(pool: PgPool, config: ProxyConfig) -> ProxyResult<Self>
pub async fn new(pool: PgPool, config: ProxyConfig) -> ProxyResult<Self>
Create a new proxy state.
Auto Trait Implementations§
impl !RefUnwindSafe for ProxyState
impl !UnwindSafe for ProxyState
impl Freeze for ProxyState
impl Send for ProxyState
impl Sync for ProxyState
impl Unpin for ProxyState
impl UnsafeUnpin for ProxyState
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more