reth::providers

Trait StaticFileWriter

Source
pub trait StaticFileWriter {
    // Required methods
    fn get_writer(
        &self,
        block: u64,
        segment: StaticFileSegment,
    ) -> Result<StaticFileProviderRWRefMut<'_>, ProviderError>;
    fn latest_writer(
        &self,
        segment: StaticFileSegment,
    ) -> Result<StaticFileProviderRWRefMut<'_>, ProviderError>;
    fn commit(&self) -> Result<(), ProviderError>;
}
Expand description

Helper trait to manage different StaticFileProviderRW of an Arc<StaticFileProvider

Required Methods§

Source

fn get_writer( &self, block: u64, segment: StaticFileSegment, ) -> Result<StaticFileProviderRWRefMut<'_>, ProviderError>

Returns a mutable reference to a StaticFileProviderRW of a StaticFileSegment.

Source

fn latest_writer( &self, segment: StaticFileSegment, ) -> Result<StaticFileProviderRWRefMut<'_>, ProviderError>

Returns a mutable reference to a StaticFileProviderRW of the latest StaticFileSegment.

Source

fn commit(&self) -> Result<(), ProviderError>

Commits all changes of all StaticFileProviderRW of all StaticFileSegment.

Implementors§