pub struct Config {
pub max_connections: u32,
pub min_connections: u32,
pub acquire_timeout: Duration,
}Expand description
Fields§
§max_connections: u32Ceiling on open connections.
High by default, and cheap to leave high: the pool opens
connections ON DEMAND and holds none idle (see
Config::min_connections), so a plugin that uses three opens
three. The ceiling only bites under real concurrency, and a
plugin that fans out should not have to discover a config knob
to do so.
It is deliberately NOT a throttle, and it matches the server’s
own max_connections=1024. Exhaustion therefore surfaces as
Postgres refusing (“too many clients already”), not as this
pool queueing — which is the right place for it: one plugin
should not be silently rationed to a fraction of a budget it
may be the only claimant on.
min_connections: u32Connections kept open when idle. Zero by default — a container that finishes its completion in a second should not have held connections open waiting for work that will never come.
acquire_timeout: DurationHow long acquire waits for a free connection before giving
up. Bounded so a query storm surfaces as an error rather than
as a plugin that hangs until the completion times out.
Trait Implementations§
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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