reth_provider

Trait BlockBodyWriter

pub trait BlockBodyWriter<Provider, Body>
where Body: BlockBody,
{ // Required methods fn write_block_bodies( &self, provider: &Provider, bodies: Vec<(u64, Option<Body>)>, write_to: StorageLocation, ) -> Result<(), ProviderError>; fn remove_block_bodies_above( &self, provider: &Provider, block: u64, remove_from: StorageLocation, ) -> Result<(), ProviderError>; }
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§

fn write_block_bodies( &self, provider: &Provider, bodies: Vec<(u64, Option<Body>)>, write_to: StorageLocation, ) -> Result<(), ProviderError>

Writes a set of block bodies to the storage.

fn remove_block_bodies_above( &self, provider: &Provider, block: u64, remove_from: StorageLocation, ) -> Result<(), ProviderError>

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

Implementations on Foreign Types§

§

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

§

fn write_block_bodies( &self, provider: &Provider, bodies: Vec<(u64, Option<Body>)>, write_to: StorageLocation, ) -> Result<(), ProviderError>

§

fn remove_block_bodies_above( &self, provider: &Provider, block: u64, remove_from: StorageLocation, ) -> Result<(), ProviderError>

§

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

§

fn write_block_bodies( &self, provider: &Provider, bodies: Vec<(u64, Option<Body>)>, write_to: StorageLocation, ) -> Result<(), ProviderError>

§

fn remove_block_bodies_above( &self, provider: &Provider, block: u64, remove_from: StorageLocation, ) -> Result<(), ProviderError>

Implementors§

§

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