pub struct PoolConfig {
pub database: Option<String>,
pub mode: PoolMode,
pub listen_mode: Option<ListenMode>,
pub max_connections: ConnectionLimits,
pub idle_timeout: Duration,
pub max_lifetime: Duration,
pub checkout_timeout: Option<Duration>,
pub user: HashMap<String, UserConfig>,
}Fields§
§database: Option<String>Override the PostgreSQL database name when it differs from the TOML key.
mode: PoolMode§listen_mode: Option<ListenMode>LISTEN/NOTIFY handling in transaction mode. Not applicable to session mode.
max_connections: ConnectionLimits§idle_timeout: Duration§max_lifetime: Duration§checkout_timeout: Option<Duration>Per-pool override of [server] checkout_timeout. When set, the
pool uses this value instead of the server-wide default. Useful
for mixing latency-sensitive OLTP pools (short timeout) with
analytics pools (long or no timeout) in the same halephant
process.
user: HashMap<String, UserConfig>Implementations§
Source§impl PoolConfig
impl PoolConfig
Sourcepub fn database_name<'a>(&'a self, key: &'a str) -> &'a str
pub fn database_name<'a>(&'a self, key: &'a str) -> &'a str
The effective database name — the explicit database field if set,
otherwise the TOML key is used by the caller.
Trait Implementations§
Source§impl Debug for PoolConfig
impl Debug for PoolConfig
Source§impl<'de> Deserialize<'de> for PoolConfig
impl<'de> Deserialize<'de> for PoolConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PoolConfig
impl RefUnwindSafe for PoolConfig
impl Send for PoolConfig
impl Sync for PoolConfig
impl Unpin for PoolConfig
impl UnsafeUnpin for PoolConfig
impl UnwindSafe for PoolConfig
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
Mutably borrows from an owned value. Read more