pub struct Pool(/* private fields */);Expand description
A pool of shared connections that can be acquired
Implementations§
Source§impl Pool
impl Pool
Sourcepub async fn connect(
connection_options: ConnectionOptions<'static>,
pool_options: PoolOptions,
) -> ConnectionResult<Self>
pub async fn connect( connection_options: ConnectionOptions<'static>, pool_options: PoolOptions, ) -> ConnectionResult<Self>
Establish a new pool with at least one connection
Sourcepub async fn acquire(&self) -> ConnectionResult<PoolConnection>
pub async fn acquire(&self) -> ConnectionResult<PoolConnection>
Acquire a free connection from the pool.
If there is no free connection wait for one to become available
The returned future is drop safe
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pool
impl RefUnwindSafe for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnwindSafe for Pool
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