Skip to main content

Segment

Trait Segment 

Source
pub trait Segment<Provider: StaticFileProviderFactory>: Send + Sync {
    // Required methods
    fn segment(&self) -> StaticFileSegment;
    fn copy_to_static_files(
        &self,
        provider: Provider,
        block_range: RangeInclusive<BlockNumber>,
    ) -> ProviderResult<()>;
}
Expand description

A segment represents moving some portion of the data to static files.

Required Methods§

Source

fn segment(&self) -> StaticFileSegment

Returns the StaticFileSegment.

Source

fn copy_to_static_files( &self, provider: Provider, block_range: RangeInclusive<BlockNumber>, ) -> ProviderResult<()>

Move data to static files for the provided block range. StaticFileProvider will handle the management of and writing to files.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Provider> Segment<Provider> for Receipts
where Provider: StaticFileProviderFactory<Primitives: NodePrimitives<Receipt: Value + Compact>> + DBProvider + BlockReader,