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))]
14
15mod traits;
17pub use traits::*;
18
19pub mod providers;
21pub use providers::{
22 DatabaseProvider, DatabaseProviderRO, DatabaseProviderRW, HistoricalStateProvider,
23 HistoricalStateProviderRef, LatestStateProvider, LatestStateProviderRef, ProviderFactory,
24 SaveBlocksMode, StaticFileAccess, StaticFileProviderBuilder, StaticFileWriteCtx,
25 StaticFileWriter,
26};
27
28pub mod changeset_walker;
29pub mod changesets_utils;
30
31#[cfg(any(test, feature = "test-utils"))]
32pub mod test_utils;
34
35pub mod either_writer;
36pub use either_writer::*;
37
38pub use reth_chain_state::{
39 CanonStateNotification, CanonStateNotificationSender, CanonStateNotificationStream,
40 CanonStateNotifications, CanonStateSubscriptions,
41};
42pub use reth_execution_types::*;
43pub use revm_database::states::OriginalValuesKnown;
45pub use reth_static_file_types as static_file;
47pub use reth_storage_api::{
48 HistoryWriter, MetadataProvider, MetadataWriter, StateWriteConfig, StatsReader,
49 StorageSettings, StorageSettingsCache,
50};
51pub use reth_storage_errors::provider::{ProviderError, ProviderResult};
53pub use static_file::StaticFileSegment;
54
55pub fn to_range<R: std::ops::RangeBounds<u64>>(bounds: R) -> std::ops::Range<u64> {
57 let start = match bounds.start_bound() {
58 std::ops::Bound::Included(&v) => v,
59 std::ops::Bound::Excluded(&v) => v + 1,
60 std::ops::Bound::Unbounded => 0,
61 };
62
63 let end = match bounds.end_bound() {
64 std::ops::Bound::Included(&v) => v + 1,
65 std::ops::Bound::Excluded(&v) => v,
66 std::ops::Bound::Unbounded => u64::MAX,
67 };
68
69 start..end
70}