pub struct PgConfig {
pub host: String,
pub port: u16,
pub database: String,
pub user: String,
pub auth: PgAuthMethod,
pub tls: PgTlsMode,
pub application_name: Option<String>,
pub connect_timeout_secs: Option<u64>,
pub max_pool_size: Option<u32>,
pub idle_timeout_secs: Option<u64>,
pub min_idle_connections: Option<u32>,
}Fields§
§host: String§port: u16§database: String§user: String§auth: PgAuthMethod§tls: PgTlsMode§application_name: Option<String>Optional application_name reported to the server. Surfaces nicely in
pg_stat_activity so DBAs can identify connections from r-shell.
connect_timeout_secs: Option<u64>Connection timeout, seconds. None falls back to the driver default.
max_pool_size: Option<u32>Maximum number of connections this profile’s pool may open.
None keeps the built-in default. Tighten on managed-DB
providers with strict max_connections quotas.
idle_timeout_secs: Option<u64>How long an idle connection lingers before the eviction loop
closes it, in seconds. None keeps the built-in default.
Lower values are politer to providers that bill on connection
hours (RDS, Neon).
min_idle_connections: Option<u32>Minimum idle connections to keep alive even past
idle_timeout_secs. Some(0) lets a profile fully evacuate
during inactivity at the cost of a reconnect on next use.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PgConfig
impl<'de> Deserialize<'de> for PgConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PgConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PgConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for PgConfig
impl Serialize for PgConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for PgConfig
impl RefUnwindSafe for PgConfig
impl Send for PgConfig
impl Sync for PgConfig
impl Unpin for PgConfig
impl UnsafeUnpin for PgConfig
impl UnwindSafe for PgConfig
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