pub struct PGRobustClientConfig<TLS> { /* private fields */ }Implementations§
Source§impl<TLS> PGRobustClientConfig<TLS>where
TLS: MakeTlsConnect<Socket> + Clone,
<TLS as MakeTlsConnect<Socket>>::Stream: Send + Sync + 'static,
impl<TLS> PGRobustClientConfig<TLS>where
TLS: MakeTlsConnect<Socket> + Clone,
<TLS as MakeTlsConnect<Socket>>::Stream: Send + Sync + 'static,
pub fn new( database_url: impl Into<String>, make_tls: TLS, ) -> PGRobustClientConfig<TLS>
pub fn subscriptions( self, subscriptions: impl IntoIterator<Item = impl Into<String>>, ) -> Self
pub fn with_subscriptions( &mut self, subscriptions: impl IntoIterator<Item = impl Into<String>>, )
pub fn without_subscriptions( &mut self, subscriptions: impl IntoIterator<Item = impl Into<String>>, )
pub fn callback( self, callback: impl Fn(PGMessage) + Send + Sync + 'static, ) -> Self
pub fn with_callback( &mut self, callback: impl Fn(PGMessage) + Send + Sync + 'static, )
pub fn max_reconnect_attempts(self, max_reconnect_attempts: u32) -> Self
pub fn with_max_reconnect_attempts( &mut self, max_reconnect_attempts: Option<u32>, )
pub fn default_timeout(self, default_timeout: Duration) -> Self
pub fn with_default_timeout(&mut self, default_timeout: Option<Duration>)
Sourcepub fn connect_script(self, connect_script: impl Into<String>) -> Self
pub fn connect_script(self, connect_script: impl Into<String>) -> Self
Sets a SQL script to execute immediately after connecting.
§Security
The provided script is executed directly as SQL. Avoid passing untrusted user input. For dynamic values, validate against an allowlist or use parameterized queries after connection.
Sourcepub fn with_connect_script(&mut self, connect_script: Option<impl Into<String>>)
pub fn with_connect_script(&mut self, connect_script: Option<impl Into<String>>)
Sets a SQL script to execute immediately after connecting.
§Security
The provided script is executed directly as SQL. Avoid passing untrusted user input. For dynamic values, validate against an allowlist or use parameterized queries after connection.
Sourcepub fn application_name(self, application_name: impl Into<String>) -> Self
pub fn application_name(self, application_name: impl Into<String>) -> Self
Sets the PostgreSQL application name for this connection.
§Security
The provided value is interpolated directly into a SET application_name
SQL statement. Avoid passing untrusted user input. For dynamic values,
validate against an allowlist of permitted application names.
Sourcepub fn with_application_name(
&mut self,
application_name: Option<impl Into<String>>,
)
pub fn with_application_name( &mut self, application_name: Option<impl Into<String>>, )
Sets the PostgreSQL application name for this connection.
§Security
The provided value is interpolated directly into a SET application_name
SQL statement. Avoid passing untrusted user input. For dynamic values,
validate against an allowlist of permitted application names.
pub fn full_connect_script(&self) -> Option<String>
Trait Implementations§
Source§impl<TLS: Clone> Clone for PGRobustClientConfig<TLS>
impl<TLS: Clone> Clone for PGRobustClientConfig<TLS>
Source§fn clone(&self) -> PGRobustClientConfig<TLS>
fn clone(&self) -> PGRobustClientConfig<TLS>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more