mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
chore(engine): Remove ConsistentDbView (#19188)
Co-authored-by: Alexey Shekhirin <5773434+shekhirin@users.noreply.github.com>
This commit is contained in:
@@ -160,6 +160,29 @@ pub trait DatabaseProviderFactory: Send + Sync {
|
||||
/// Helper type alias to get the associated transaction type from a [`DatabaseProviderFactory`].
|
||||
pub type FactoryTx<F> = <<F as DatabaseProviderFactory>::DB as Database>::TX;
|
||||
|
||||
/// A trait which can be used to describe any factory-like type which returns a read-only provider.
|
||||
pub trait DatabaseProviderROFactory {
|
||||
/// Provider type returned by this factory.
|
||||
///
|
||||
/// This type is intentionally left unconstrained; constraints can be added as-needed when this
|
||||
/// is used.
|
||||
type Provider;
|
||||
|
||||
/// Creates and returns a Provider.
|
||||
fn database_provider_ro(&self) -> ProviderResult<Self::Provider>;
|
||||
}
|
||||
|
||||
impl<T> DatabaseProviderROFactory for T
|
||||
where
|
||||
T: DatabaseProviderFactory,
|
||||
{
|
||||
type Provider = T::Provider;
|
||||
|
||||
fn database_provider_ro(&self) -> ProviderResult<Self::Provider> {
|
||||
<T as DatabaseProviderFactory>::database_provider_ro(self)
|
||||
}
|
||||
}
|
||||
|
||||
fn range_size_hint(range: &impl RangeBounds<u64>) -> Option<usize> {
|
||||
let start = match range.start_bound().cloned() {
|
||||
Bound::Included(start) => start,
|
||||
|
||||
Reference in New Issue
Block a user