pub struct PoolPrewarmConfig {
pub min_size: usize,
pub max_size: usize,
pub timeout_secs: Option<u64>,
}Expand description
Configuration for connection pool construction and pre-warming.
Controls the minimum guaranteed connections (pre-warmed at startup), the maximum pool ceiling, and the wait/create timeout for connection acquisition.
§Example
use fraiseql_db::postgres::PoolPrewarmConfig;
let cfg = PoolPrewarmConfig {
min_size: 5,
max_size: 20,
timeout_secs: Some(30),
};Fields§
§min_size: usizeNumber of connections to establish at pool creation time.
After the pool is created, min_size connections are opened eagerly
so they are ready when the first request arrives. Set to 0 to disable
pre-warming (lazy init — one connection from the startup health check).
max_size: usizeMaximum number of connections the pool may hold.
timeout_secs: Option<u64>Optional timeout (in seconds) for connection acquisition and creation.
Applied to both the wait (blocked waiting for an idle connection) and
create (time to open a new TCP connection to PostgreSQL) deadpool slots.
When None, acquisition can block indefinitely on pool exhaustion.
Trait Implementations§
Source§impl Clone for PoolPrewarmConfig
impl Clone for PoolPrewarmConfig
Source§fn clone(&self) -> PoolPrewarmConfig
fn clone(&self) -> PoolPrewarmConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PoolPrewarmConfig
impl RefUnwindSafe for PoolPrewarmConfig
impl Send for PoolPrewarmConfig
impl Sync for PoolPrewarmConfig
impl Unpin for PoolPrewarmConfig
impl UnsafeUnpin for PoolPrewarmConfig
impl UnwindSafe for PoolPrewarmConfig
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<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