Skip to main content

DatabaseFactory

Trait DatabaseFactory 

Source
pub trait DatabaseFactory: Send + Sync {
    type Client: DatabaseClient;

    // Required method
    fn connect<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Client>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A factory trait for creating database clients.

Required Associated Types§

Required Methods§

Source

fn connect<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Self::Client>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Connect to the database using a connection string.

Implementors§