pub trait StaticFileWriter {
type Primitives: Send + Sync + 'static;
// Required methods
fn get_writer(
&self,
block: BlockNumber,
segment: StaticFileSegment,
) -> ProviderResult<StaticFileProviderRWRefMut<'_, Self::Primitives>>;
fn latest_writer(
&self,
segment: StaticFileSegment,
) -> ProviderResult<StaticFileProviderRWRefMut<'_, Self::Primitives>>;
fn commit(&self) -> ProviderResult<()>;
}
Expand description
Helper trait to manage different StaticFileProviderRW
of an Arc<StaticFileProvider
Required Associated Types§
Sourcetype Primitives: Send + Sync + 'static
type Primitives: Send + Sync + 'static
The primitives type used by the static file provider.
Required Methods§
Sourcefn get_writer(
&self,
block: BlockNumber,
segment: StaticFileSegment,
) -> ProviderResult<StaticFileProviderRWRefMut<'_, Self::Primitives>>
fn get_writer( &self, block: BlockNumber, segment: StaticFileSegment, ) -> ProviderResult<StaticFileProviderRWRefMut<'_, Self::Primitives>>
Returns a mutable reference to a StaticFileProviderRW
of a [StaticFileSegment
].
Sourcefn latest_writer(
&self,
segment: StaticFileSegment,
) -> ProviderResult<StaticFileProviderRWRefMut<'_, Self::Primitives>>
fn latest_writer( &self, segment: StaticFileSegment, ) -> ProviderResult<StaticFileProviderRWRefMut<'_, Self::Primitives>>
Returns a mutable reference to a StaticFileProviderRW
of the latest
[StaticFileSegment
].
Sourcefn commit(&self) -> ProviderResult<()>
fn commit(&self) -> ProviderResult<()>
Commits all changes of all StaticFileProviderRW
of all [StaticFileSegment
].