Skip to main content

PruningDataSource

Trait PruningDataSource 

Source
pub(crate) trait PruningDataSource {
    // Required methods
    fn get_oldest_block(
        &self,
    ) -> impl Send + Future<Output = Result<Option<BlockQueryData<SeqTypes>>>>;
    fn get_oldest_leaf(
        &self,
    ) -> impl Send + Future<Output = Result<Option<LeafQueryData<SeqTypes>>>>;
}
Expand description

Data source for pruning state: the oldest retained block and leaf.

SQL backends return the actual oldest entry; the filesystem backend always returns None since it does not prune.

Required Methods§

Source

fn get_oldest_block( &self, ) -> impl Send + Future<Output = Result<Option<BlockQueryData<SeqTypes>>>>

Get the oldest block in storage, or None if empty or unsupported.

Source

fn get_oldest_leaf( &self, ) -> impl Send + Future<Output = Result<Option<LeafQueryData<SeqTypes>>>>

Get the oldest leaf in storage, or None if empty or unsupported.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl PruningDataSource for SqlStorage

Source§

async fn get_oldest_block(&self) -> Result<Option<BlockQueryData<SeqTypes>>>

Source§

async fn get_oldest_leaf(&self) -> Result<Option<LeafQueryData<SeqTypes>>>

Source§

impl<N, P, D> PruningDataSource for ExtensibleDataSource<D, ApiState<N, P>>
where N: ConnectedNetwork<PubKey>, P: SequencerPersistence, D: PruningDataSource + Send + Sync + CatchupStorage,

Source§

async fn get_oldest_block(&self) -> Result<Option<BlockQueryData<SeqTypes>>>

Source§

async fn get_oldest_leaf(&self) -> Result<Option<LeafQueryData<SeqTypes>>>

Implementors§

Source§

impl PruningDataSource for espresso_node::api::fs::DataSource

Source§

impl PruningDataSource for espresso_node::api::sql::DataSource