reth::providers

Trait BlockBodyWriter

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

Writes a set of block bodies to the storage.

fn remove_block_bodies_above( &self, provider: &Provider, block: u64, ) -> 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>)>, ) -> Result<(), ProviderError>

§

fn remove_block_bodies_above( &self, provider: &Provider, block: u64, ) -> 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>)>, ) -> Result<(), ProviderError>

§

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

Implementors§

§

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