Struct bb8_postgres::PostgresConnectionManager
source · [−]pub struct PostgresConnectionManager<Tls> where
Tls: MakeTlsConnect<Socket>, { /* private fields */ }
Expand description
A bb8::ManageConnection
for tokio_postgres::Connection
s.
Implementations
sourceimpl<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
sourceimpl<Tls: Clone> Clone for PostgresConnectionManager<Tls> where
Tls: MakeTlsConnect<Socket>,
impl<Tls: Clone> Clone for PostgresConnectionManager<Tls> where
Tls: MakeTlsConnect<Socket>,
sourcefn clone(&self) -> PostgresConnectionManager<Tls>
fn clone(&self) -> PostgresConnectionManager<Tls>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<Tls> Debug for PostgresConnectionManager<Tls> where
Tls: MakeTlsConnect<Socket>,
impl<Tls> Debug for PostgresConnectionManager<Tls> where
Tls: MakeTlsConnect<Socket>,
sourceimpl<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,
type Connection = Client
type Connection = Client
The connection type this manager deals with.
sourcefn connect<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Attempts to create a new connection.
sourcefn is_valid<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Self::Connection
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn is_valid<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Self::Connection
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Determines if the connection is still connected to the database.
sourcefn 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> 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more