pub struct Pool<M>(/* private fields */)
where
M: ManageConnection;
Expand description
A generic connection pool.
Implementations§
Source§impl<M> Pool<M>where
M: ManageConnection,
impl<M> Pool<M>where
M: ManageConnection,
Sourcepub async fn get_timeout(
&self,
connection_timeout: Option<Duration>,
) -> Result<M::Connection>
pub async fn get_timeout( &self, connection_timeout: Option<Duration>, ) -> Result<M::Connection>
Retrieves a connection from the pool.
Waits for at most the connection timeout before returning an error.
Sourcepub async fn get(&self) -> Result<Connection<M>>
pub async fn get(&self) -> Result<Connection<M>>
Retrieves a connection from the pool.
Waits for at most the configured connection timeout before returning an error.
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for Pool<M>
impl<M> RefUnwindSafe for Pool<M>where
M: RefUnwindSafe,
impl<M> Send for Pool<M>
impl<M> Sync for Pool<M>
impl<M> Unpin for Pool<M>
impl<M> UnwindSafe for Pool<M>where
M: RefUnwindSafe,
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