spin_factor_sqlite

Trait ConnectionCreator

Source
pub trait ConnectionCreator: Send + Sync {
    // Required method
    fn create_connection<'life0, 'life1, 'async_trait>(
        &'life0 self,
        label: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection + 'static>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A creator of a connections for a particular SQLite database.

Required Methods§

Source

fn create_connection<'life0, 'life1, 'async_trait>( &'life0 self, label: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection + 'static>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a new Connection

The connection should be a new connection, not a reused one.

Implementors§

Source§

impl<F> ConnectionCreator for F
where F: Fn() -> Result<Box<dyn Connection + 'static>> + Send + Sync + 'static,