reth_storage_api

Trait DatabaseProviderFactory

Source
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) -> ProviderResult<Self::Provider>;
    fn database_provider_rw(&self) -> ProviderResult<Self::ProviderRW>;
}
Expand description

Database provider factory.

Required Associated Types§

Source

type DB: Database

Database this factory produces providers for.

Source

type Provider: DBProvider<Tx = <Self::DB as Database>::TX>

Provider type returned by the factory.

Source

type ProviderRW: DBProvider<Tx = <Self::DB as Database>::TXMut>

Read-write provider type returned by the factory.

Required Methods§

Source

fn database_provider_ro(&self) -> ProviderResult<Self::Provider>

Create new read-only database provider.

Source

fn database_provider_rw(&self) -> ProviderResult<Self::ProviderRW>

Create new read-write database provider.

Implementations on Foreign Types§

Source§

impl<'a, T: 'a + DatabaseProviderFactory + ?Sized> DatabaseProviderFactory for &'a T
where &'a T: Send + Sync,

Source§

impl<T: DatabaseProviderFactory + ?Sized> DatabaseProviderFactory for Arc<T>
where Arc<T>: Send + Sync,

Implementors§