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§
Sourcefn write_block_bodies(
&self,
provider: &Provider,
bodies: Vec<(BlockNumber, Option<Body>)>,
write_to: StorageLocation,
) -> ProviderResult<()>
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.
Sourcefn remove_block_bodies_above(
&self,
provider: &Provider,
block: BlockNumber,
remove_from: StorageLocation,
) -> ProviderResult<()>
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.