pub struct ConnectionBuilder<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
Tls::Stream: Sync + Send,
Tls::TlsConnect: Sync + Send,
<Tls::TlsConnect as TlsConnect<Socket>>::Future: Send,{ /* private fields */ }Expand description
Implementations§
Source§impl<Tls> ConnectionBuilder<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
Tls::Stream: Sync + Send,
Tls::TlsConnect: Sync + Send,
<Tls::TlsConnect as TlsConnect<Socket>>::Future: Send,
impl<Tls> ConnectionBuilder<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
Tls::Stream: Sync + Send,
Tls::TlsConnect: Sync + Send,
<Tls::TlsConnect as TlsConnect<Socket>>::Future: Send,
Sourcepub fn tls<NewTls>(self, tls: NewTls) -> ConnectionBuilder<NewTls>where
NewTls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
NewTls::Stream: Sync + Send,
NewTls::TlsConnect: Sync + Send,
<NewTls::TlsConnect as TlsConnect<Socket>>::Future: Send,
pub fn tls<NewTls>(self, tls: NewTls) -> ConnectionBuilder<NewTls>where
NewTls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
NewTls::Stream: Sync + Send,
NewTls::TlsConnect: Sync + Send,
<NewTls::TlsConnect as TlsConnect<Socket>>::Future: Send,
Set the Tls method.
Use either postgres-openssl
or postgres-nativ-tls
and their respective documentation.
This function accepts the same types as tokio-postgres.
Sourcepub fn max_pool_size(self, n: usize) -> Self
pub fn max_pool_size(self, n: usize) -> Self
Set the maximum size of the connection pool, i.e. the maximum amount of concurrent connections to the database server.
The default is num_cpus * 4, ignoring hyperthreading, etc.
Auto Trait Implementations§
impl<Tls> Freeze for ConnectionBuilder<Tls>where
Tls: Freeze,
impl<Tls> RefUnwindSafe for ConnectionBuilder<Tls>where
Tls: RefUnwindSafe,
impl<Tls> Send for ConnectionBuilder<Tls>
impl<Tls> Sync for ConnectionBuilder<Tls>
impl<Tls> Unpin for ConnectionBuilder<Tls>where
Tls: Unpin,
impl<Tls> UnwindSafe for ConnectionBuilder<Tls>where
Tls: UnwindSafe,
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