pub struct PgPool {
pub manager: PgConnectionManager,
pub inner: Pool<PgConnectionManager>,
}Fields§
§manager: PgConnectionManager§inner: Pool<PgConnectionManager>Implementations§
Source§impl PgPool
impl PgPool
Sourcepub async fn get(&self) -> Result<PgConnection, Error<PgError>>
pub async fn get(&self) -> Result<PgConnection, Error<PgError>>
Returns a single connection by either opening a new connection or returning an existing connection from the connection pool. Conn will block until either a connection is returned or timeout.
Sourcepub async fn get_timeout(
&self,
duration: Duration,
) -> Result<PgConnection, Error<PgError>>
pub async fn get_timeout( &self, duration: Duration, ) -> Result<PgConnection, Error<PgError>>
Retrieves a connection from the pool, waiting for at most timeout
The given timeout will be used instead of the configured connection timeout.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PgPool
impl !RefUnwindSafe for PgPool
impl Send for PgPool
impl Sync for PgPool
impl Unpin for PgPool
impl !UnwindSafe for PgPool
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