pub struct PostgresConnectionManager<Tls>where
Tls: MakeTlsConnect<Socket>,{ /* private fields */ }Expand description
A bb8::ManageConnection for tokio_postgres::Connections.
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 duplicate 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§fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<<PostgresConnectionManager<Tls> as ManageConnection>::Connection, <PostgresConnectionManager<Tls> as ManageConnection>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
PostgresConnectionManager<Tls>: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<<PostgresConnectionManager<Tls> as ManageConnection>::Connection, <PostgresConnectionManager<Tls> as ManageConnection>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
PostgresConnectionManager<Tls>: 'async_trait,
Attempts to create a new connection.
Source§fn is_valid<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut <PostgresConnectionManager<Tls> as ManageConnection>::Connection,
) -> Pin<Box<dyn Future<Output = Result<(), <PostgresConnectionManager<Tls> as ManageConnection>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
PostgresConnectionManager<Tls>: 'async_trait,
fn is_valid<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut <PostgresConnectionManager<Tls> as ManageConnection>::Connection,
) -> Pin<Box<dyn Future<Output = Result<(), <PostgresConnectionManager<Tls> as ManageConnection>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
PostgresConnectionManager<Tls>: 'async_trait,
Determines if the connection is still connected to the database.
Source§fn has_broken(
&self,
conn: &mut <PostgresConnectionManager<Tls> as ManageConnection>::Connection,
) -> bool
fn has_broken( &self, conn: &mut <PostgresConnectionManager<Tls> as ManageConnection>::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