pub struct Pool { /* private fields */ }Expand description
Database connection pool.
Implementations§
Source§impl Pool
impl Pool
Sourcepub fn connect_lazy(url: &str) -> Result<Self>
pub fn connect_lazy(url: &str) -> Result<Self>
Create Pool without trying to create connection.
Sourcepub async fn connect_env() -> Result<Pool>
pub async fn connect_env() -> Result<Pool>
Create Pool and try to create one connection.
See Config::from_env for more details on env.
Sourcepub async fn connect_with(config: PoolConfig) -> Result<Self>
pub async fn connect_with(config: PoolConfig) -> Result<Self>
Create Pool and try to create one connection.
Sourcepub fn connect_lazy_with(config: PoolConfig) -> Self
pub fn connect_lazy_with(config: PoolConfig) -> Self
Create Pool without trying to create connection.
Trait Implementations§
Source§impl Executor for &Pool
impl Executor for &Pool
Source§type Transport = PoolConnection<'static>
type Transport = PoolConnection<'static>
The returned transport.
Source§type Future = PoolConnect<'static>
type Future = PoolConnect<'static>
Future that resolve to
Executor::Transport.Source§fn connection(self) -> Self::Future
fn connection(self) -> Self::Future
Acquire the transport.
Source§impl<'a> Executor for &'a mut Pool
impl<'a> Executor for &'a mut Pool
Source§type Transport = PoolConnection<'a>
type Transport = PoolConnection<'a>
The returned transport.
Source§type Future = PoolConnect<'a>
type Future = PoolConnect<'a>
Future that resolve to
Executor::Transport.Source§fn connection(self) -> Self::Future
fn connection(self) -> Self::Future
Acquire the transport.
Source§impl Executor for Pool
impl Executor for Pool
Source§type Transport = PoolConnection<'static>
type Transport = PoolConnection<'static>
The returned transport.
Source§type Future = PoolConnect<'static>
type Future = PoolConnect<'static>
Future that resolve to
Executor::Transport.Source§fn connection(self) -> Self::Future
fn connection(self) -> Self::Future
Acquire the transport.
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