reth_provider/
lib.rs
1#![doc(
8 html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
9 html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
10 issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
11)]
12#![cfg_attr(not(test), warn(unused_crate_dependencies))]
13#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
14
15mod traits;
17pub use traits::*;
18
19pub mod providers;
21pub use providers::{
22 DatabaseProvider, DatabaseProviderRO, DatabaseProviderRW, HistoricalStateProvider,
23 HistoricalStateProviderRef, LatestStateProvider, LatestStateProviderRef, ProviderFactory,
24 StaticFileAccess, StaticFileWriter,
25};
26
27#[cfg(any(test, feature = "test-utils"))]
28pub mod test_utils;
30pub use reth_storage_errors::provider::{ProviderError, ProviderResult};
32
33pub use reth_static_file_types as static_file;
34pub use static_file::StaticFileSegment;
35
36pub use reth_execution_types::*;
37
38pub mod bundle_state;
39
40pub use revm_database::states::OriginalValuesKnown;
42
43pub mod writer;
45
46pub use reth_chain_state::{
47 CanonStateNotification, CanonStateNotificationSender, CanonStateNotificationStream,
48 CanonStateNotifications, CanonStateSubscriptions,
49};
50
51pub use reth_storage_api::{HistoryWriter, StatsReader};
53
54pub(crate) fn to_range<R: std::ops::RangeBounds<u64>>(bounds: R) -> std::ops::Range<u64> {
55 let start = match bounds.start_bound() {
56 std::ops::Bound::Included(&v) => v,
57 std::ops::Bound::Excluded(&v) => v + 1,
58 std::ops::Bound::Unbounded => 0,
59 };
60
61 let end = match bounds.end_bound() {
62 std::ops::Bound::Included(&v) => v + 1,
63 std::ops::Bound::Excluded(&v) => v,
64 std::ops::Bound::Unbounded => u64::MAX,
65 };
66
67 start..end
68}