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