mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
24 lines
737 B
Rust
24 lines
737 B
Rust
use reth_interfaces::provider::ProviderResult;
|
|
use reth_primitives::{PruneCheckpoint, PruneSegment};
|
|
|
|
/// The trait for fetching prune checkpoint related data.
|
|
#[auto_impl::auto_impl(&, Arc)]
|
|
pub trait PruneCheckpointReader: Send + Sync {
|
|
/// Fetch the checkpoint for the given prune segment.
|
|
fn get_prune_checkpoint(
|
|
&self,
|
|
segment: PruneSegment,
|
|
) -> ProviderResult<Option<PruneCheckpoint>>;
|
|
}
|
|
|
|
/// The trait for updating prune checkpoint related data.
|
|
#[auto_impl::auto_impl(&, Arc)]
|
|
pub trait PruneCheckpointWriter: Send + Sync {
|
|
/// Save prune checkpoint.
|
|
fn save_prune_checkpoint(
|
|
&self,
|
|
segment: PruneSegment,
|
|
checkpoint: PruneCheckpoint,
|
|
) -> ProviderResult<()>;
|
|
}
|