pub trait DatabasePool:
Send
+ Sync
+ Clone {
type Connection: Connection;
// Required methods
fn acquire<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn release<'life0, 'async_trait>(
&'life0 self,
conn: Self::Connection,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
A trait for database pools that can be used to acquire and release connections
Required Associated Types§
Sourcetype Connection: Connection
type Connection: Connection
The type of connection this pool provides
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.