Trait DatabaseProviderFactory
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§
type DB: Database
type DB: Database
Database this factory produces providers for.
type Provider: DBProvider<Tx = <Self::DB as Database>::TX>
type Provider: DBProvider<Tx = <Self::DB as Database>::TX>
Provider type returned by the factory.
type 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§
fn database_provider_ro(&self) -> Result<Self::Provider, ProviderError>
fn database_provider_ro(&self) -> Result<Self::Provider, ProviderError>
Create new read-only database provider.
fn database_provider_rw(&self) -> Result<Self::ProviderRW, ProviderError>
fn database_provider_rw(&self) -> Result<Self::ProviderRW, ProviderError>
Create new read-write database provider.
Implementations on Foreign Types§
§impl<'a, T> DatabaseProviderFactory for &'a T
impl<'a, T> DatabaseProviderFactory for &'a T
type DB = <T as DatabaseProviderFactory>::DB
type Provider = <T as DatabaseProviderFactory>::Provider
type ProviderRW = <T as DatabaseProviderFactory>::ProviderRW
fn database_provider_ro( &self, ) -> Result<<&'a T as DatabaseProviderFactory>::Provider, ProviderError>
fn database_provider_rw( &self, ) -> Result<<&'a T as DatabaseProviderFactory>::ProviderRW, ProviderError>
§impl<T> DatabaseProviderFactory for Arc<T>
impl<T> DatabaseProviderFactory for Arc<T>
type DB = <T as DatabaseProviderFactory>::DB
type Provider = <T as DatabaseProviderFactory>::Provider
type ProviderRW = <T as DatabaseProviderFactory>::ProviderRW
fn database_provider_ro( &self, ) -> Result<<Arc<T> as DatabaseProviderFactory>::Provider, ProviderError>
fn database_provider_rw( &self, ) -> Result<<Arc<T> as DatabaseProviderFactory>::ProviderRW, ProviderError>
Implementors§
Source§impl DatabaseProviderFactory for MockEthProvider
Available on crate feature test-utils
only.
impl DatabaseProviderFactory for MockEthProvider
Available on crate feature
test-utils
only.