pub trait DatabaseFactory: Send + Sync {
// Required method
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 DatabaseConfig,
) -> Pin<Box<dyn Future<Output = AppResult<Arc<dyn DatabaseClient>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Factory for a named database backend.
Required Methods§
Sourcefn create<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 DatabaseConfig,
) -> Pin<Box<dyn Future<Output = AppResult<Arc<dyn DatabaseClient>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 DatabaseConfig,
) -> Pin<Box<dyn Future<Output = AppResult<Arc<dyn DatabaseClient>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Build a database client from database configuration.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".