Trait deadpool_postgres::Connect

source ·
pub trait Connect: Sync + Send {
    // Required method
    fn connect(
        &self,
        pg_config: &PgConfig
    ) -> Pin<Box<dyn Future<Output = Result<(PgClient, JoinHandle<()>), Error>> + Send + '_>>;
}
Expand description

Describes a mechanism for establishing a connection to a PostgreSQL server via tokio_postgres.

Required Methods§

source

fn connect( &self, pg_config: &PgConfig ) -> Pin<Box<dyn Future<Output = Result<(PgClient, JoinHandle<()>), Error>> + Send + '_>>

Establishes a new tokio_postgres connection, returning the associated Client and a JoinHandle to a tokio task for processing the connection.

Implementors§