chore(engine): Remove ConsistentDbView (#19188)

Co-authored-by: Alexey Shekhirin <5773434+shekhirin@users.noreply.github.com>
This commit is contained in:
Brian Picciano
2025-10-27 20:09:21 +01:00
committed by GitHub
parent a264ccbbc2
commit ffeaa4772d
18 changed files with 384 additions and 559 deletions

View File

@@ -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,