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