[−][src]Struct c3p0_pg_async::pg_async::bb8::Pool
A generic connection pool.
Methods
impl<M> Pool<M> where
M: ManageConnection,
[src]
M: ManageConnection,
pub fn builder() -> Builder<M>
[src]
Returns a Builder
instance to configure a new pool.
pub fn state(&self) -> State
[src]
Returns information about the current state of the pool.
pub async fn run<'a, T, E, U, F>(&'_ self, f: F) -> Result<T, RunError<E>> where
E: From<<M as ManageConnection>::Error> + Send + 'a,
F: FnOnce(<M as ManageConnection>::Connection) -> U + Send + 'a,
T: Send + 'a,
U: Future<Output = Result<(T, <M as ManageConnection>::Connection), (E, <M as ManageConnection>::Connection)>> + Send + 'a,
[src]
E: From<<M as ManageConnection>::Error> + Send + 'a,
F: FnOnce(<M as ManageConnection>::Connection) -> U + Send + 'a,
T: Send + 'a,
U: Future<Output = Result<(T, <M as ManageConnection>::Connection), (E, <M as ManageConnection>::Connection)>> + Send + 'a,
Run a closure with a Connection
.
pub async fn get(
&'_ self
) -> Result<PooledConnection<'_, M>, RunError<<M as ManageConnection>::Error>>
[src]
&'_ self
) -> Result<PooledConnection<'_, M>, RunError<<M as ManageConnection>::Error>>
Retrieves a connection from the pool.
pub async fn dedicated_connection(
&'_ self
) -> Result<<M as ManageConnection>::Connection, <M as ManageConnection>::Error>
[src]
&'_ self
) -> Result<<M as ManageConnection>::Connection, <M as ManageConnection>::Error>
Get a new dedicated connection that will not be managed by the pool. An application may want a persistent connection (e.g. to do a postgres LISTEN) that will not be closed or repurposed by the pool.
This method allows reusing the manager's configuration but otherwise bypassing the pool
Trait Implementations
impl<M> Clone for Pool<M> where
M: ManageConnection,
[src]
M: ManageConnection,
impl<M> Debug for Pool<M> where
M: ManageConnection,
[src]
M: ManageConnection,
impl Into<PgC3p0Pool> for Pool<PostgresConnectionManager<NoTls>>
[src]
fn into(self) -> PgC3p0Pool
[src]
Auto Trait Implementations
impl<M> !RefUnwindSafe for Pool<M>
impl<M> Send for Pool<M> where
<M as ManageConnection>::Connection: Send,
<M as ManageConnection>::Connection: Send,
impl<M> Sync for Pool<M> where
<M as ManageConnection>::Connection: Send,
<M as ManageConnection>::Connection: Send,
impl<M> Unpin for Pool<M>
impl<M> !UnwindSafe for Pool<M>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,