reth_storage_api

Trait BlockBodyWriter

Source
pub trait BlockBodyWriter<Provider, Body: BlockBody> {
    // Required methods
    fn write_block_bodies(
        &self,
        provider: &Provider,
        bodies: Vec<(BlockNumber, Option<Body>)>,
        write_to: StorageLocation,
    ) -> ProviderResult<()>;
    fn remove_block_bodies_above(
        &self,
        provider: &Provider,
        block: BlockNumber,
        remove_from: StorageLocation,
    ) -> ProviderResult<()>;
}
Expand description

Trait that implements how block bodies are written to the storage.

Note: Within the current abstraction, this should only write to tables unrelated to transactions. Writing of transactions is handled separately.

Required Methods§

Source

fn write_block_bodies( &self, provider: &Provider, bodies: Vec<(BlockNumber, Option<Body>)>, write_to: StorageLocation, ) -> ProviderResult<()>

Writes a set of block bodies to the storage.

Source

fn remove_block_bodies_above( &self, provider: &Provider, block: BlockNumber, remove_from: StorageLocation, ) -> ProviderResult<()>

Removes all block bodies above the given block number from the database.

Implementations on Foreign Types§

Source§

impl<'a, Provider, Body: BlockBody, T: 'a + BlockBodyWriter<Provider, Body> + ?Sized> BlockBodyWriter<Provider, Body> for &'a T

Source§

fn write_block_bodies( &self, provider: &Provider, bodies: Vec<(BlockNumber, Option<Body>)>, write_to: StorageLocation, ) -> ProviderResult<()>

Source§

fn remove_block_bodies_above( &self, provider: &Provider, block: BlockNumber, remove_from: StorageLocation, ) -> ProviderResult<()>

Source§

impl<Provider, Body: BlockBody, T: BlockBodyWriter<Provider, Body> + ?Sized> BlockBodyWriter<Provider, Body> for Arc<T>

Source§

fn write_block_bodies( &self, provider: &Provider, bodies: Vec<(BlockNumber, Option<Body>)>, write_to: StorageLocation, ) -> ProviderResult<()>

Source§

fn remove_block_bodies_above( &self, provider: &Provider, block: BlockNumber, remove_from: StorageLocation, ) -> ProviderResult<()>

Implementors§

Source§

impl<Provider> BlockBodyWriter<Provider, BlockBody> for EthStorage
where Provider: DBProvider<Tx: DbTxMut>,