pub trait DbConnect: Sync {
type Database: Database;
type Error: Error;
// Required method
fn connect(&self) -> Result<Self::Database, Self::Error>;
}Expand description
Trait for types that can be used to connect to a database.
Connectors should contain configuration information like filesystem paths. They are intended to enable parallel instantiation of multiple EVMs in multiple threads sharing some database configuration
The lifetime on this trait allows the resulting DB to borrow from the
connector. E.g. the connector may contain some Db and the resulting Db may
contain &Db. This allows for (e.g.) shared caches between DBs on multiple
threads.