pub trait ConnectionProvider {
    type Error;
    type Connection: Connection<Backend = Pg>;

    fn get(&self) -> Result<Self::Connection, Self::Error>;
}
Expand description

Trait for types providing database connections. This is typically implemented by an Arc<ConnectionPool> or functionally equivalent type.

Required Associated Types§

Error type which may be returned when the provider is unable to obtain a database connection.

Type of the connection returned. Currently the connection must use the postgres backend.

Required Methods§

Obtain a connection from this provider.

Implementors§