pub trait DatabaseProviderFactory: Send + Sync {
type DB: Database;
type Provider: DBProvider<Tx = <Self::DB as Database>::TX>;
type ProviderRW: DBProvider<Tx = <Self::DB as Database>::TXMut>;
// Required methods
fn database_provider_ro(&self) -> Result<Self::Provider, ProviderError>;
fn database_provider_rw(&self) -> Result<Self::ProviderRW, ProviderError>;
}
Expand description
Database provider factory.
Required Associated Types§
Sourcetype Provider: DBProvider<Tx = <Self::DB as Database>::TX>
type Provider: DBProvider<Tx = <Self::DB as Database>::TX>
Provider type returned by the factory.
Sourcetype ProviderRW: DBProvider<Tx = <Self::DB as Database>::TXMut>
type ProviderRW: DBProvider<Tx = <Self::DB as Database>::TXMut>
Read-write provider type returned by the factory.
Required Methods§
Sourcefn database_provider_ro(&self) -> Result<Self::Provider, ProviderError>
fn database_provider_ro(&self) -> Result<Self::Provider, ProviderError>
Create new read-only database provider.
Sourcefn database_provider_rw(&self) -> Result<Self::ProviderRW, ProviderError>
fn database_provider_rw(&self) -> Result<Self::ProviderRW, ProviderError>
Create new read-write database provider.