pub trait DatabasePool:
Send
+ Sync
+ Clone {
type Connection: Send + Sync + TestDatabaseConnection;
type Error: Send + Sync + From<String> + Display + Debug;
// Required methods
fn acquire<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn release<'life0, 'async_trait>(
&'life0 self,
conn: Self::Connection,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn connection_string(&self) -> String;
}
Expand description
Re-export the traits from testkit-core
Required Associated Types§
type Connection: Send + Sync + TestDatabaseConnection
type Error: Send + Sync + From<String> + Display + Debug
Required Methods§
fn acquire<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn release<'life0, 'async_trait>(
&'life0 self,
conn: Self::Connection,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn connection_string(&self) -> String
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.