pub struct PostgresConnectionManager<Tls>where
Tls: MakeTlsConnect<Socket>,{ /* private fields */ }
Expand description
A bb8::ManageConnection
for tokio_postgres::Connection
s.
Implementations§
Source§impl<Tls> PostgresConnectionManager<Tls>where
Tls: MakeTlsConnect<Socket>,
impl<Tls> PostgresConnectionManager<Tls>where
Tls: MakeTlsConnect<Socket>,
Sourcepub fn new(config: Config, tls: Tls) -> PostgresConnectionManager<Tls>
pub fn new(config: Config, tls: Tls) -> PostgresConnectionManager<Tls>
Create a new PostgresConnectionManager
with the specified config
.
Sourcepub fn new_from_stringlike<T>(
params: T,
tls: Tls,
) -> Result<PostgresConnectionManager<Tls>, Error>where
T: ToString,
pub fn new_from_stringlike<T>(
params: T,
tls: Tls,
) -> Result<PostgresConnectionManager<Tls>, Error>where
T: ToString,
Create a new PostgresConnectionManager
, parsing the config from params
.
Trait Implementations§
Source§impl<Tls> Clone for PostgresConnectionManager<Tls>
impl<Tls> Clone for PostgresConnectionManager<Tls>
Source§fn clone(&self) -> PostgresConnectionManager<Tls>
fn clone(&self) -> PostgresConnectionManager<Tls>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<Tls> Debug for PostgresConnectionManager<Tls>where
Tls: MakeTlsConnect<Socket>,
impl<Tls> Debug for PostgresConnectionManager<Tls>where
Tls: MakeTlsConnect<Socket>,
Source§impl<Tls> ManageConnection for PostgresConnectionManager<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
impl<Tls> ManageConnection for PostgresConnectionManager<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
Source§type Connection = Client
type Connection = Client
The connection type this manager deals with.
Source§async fn connect(&self) -> Result<Self::Connection, Self::Error>
async fn connect(&self) -> Result<Self::Connection, Self::Error>
Attempts to create a new connection.
Source§async fn is_valid(&self, conn: &mut Self::Connection) -> Result<(), Self::Error>
async fn is_valid(&self, conn: &mut Self::Connection) -> Result<(), Self::Error>
Determines if the connection is still connected to the database.
Source§fn has_broken(&self, conn: &mut Self::Connection) -> bool
fn has_broken(&self, conn: &mut Self::Connection) -> bool
Synchronously determine if the connection is no longer usable, if possible.
Auto Trait Implementations§
impl<Tls> Freeze for PostgresConnectionManager<Tls>where
Tls: Freeze,
impl<Tls> RefUnwindSafe for PostgresConnectionManager<Tls>where
Tls: RefUnwindSafe,
impl<Tls> Send for PostgresConnectionManager<Tls>where
Tls: Send,
impl<Tls> Sync for PostgresConnectionManager<Tls>where
Tls: Sync,
impl<Tls> Unpin for PostgresConnectionManager<Tls>where
Tls: Unpin,
impl<Tls> UnwindSafe for PostgresConnectionManager<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