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§
Sourcefn segment(&self) -> StaticFileSegment
fn segment(&self) -> StaticFileSegment
Returns the StaticFileSegment
.
Sourcefn copy_to_static_files(
&self,
provider: Provider,
block_range: RangeInclusive<BlockNumber>,
) -> ProviderResult<()>
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.