[][src]Trait asuran::repository::backend::common::sync_backend::SyncIndex

pub trait SyncIndex: Debug {
    fn lookup_chunk(&mut self, id: ChunkID) -> Option<SegmentDescriptor>;
fn set_chunk(
        &mut self,
        id: ChunkID,
        location: SegmentDescriptor
    ) -> Result<()>;
fn known_chunks(&mut self) -> HashSet<ChunkID>;
fn commit_index(&mut self) -> Result<()>;
fn chunk_count(&mut self) -> usize; }

Required methods

fn lookup_chunk(&mut self, id: ChunkID) -> Option<SegmentDescriptor>

fn set_chunk(&mut self, id: ChunkID, location: SegmentDescriptor) -> Result<()>

fn known_chunks(&mut self) -> HashSet<ChunkID>

fn commit_index(&mut self) -> Result<()>

fn chunk_count(&mut self) -> usize

Loading content...

Implementors

impl SyncIndex for FlatFile[src]

impl SyncIndex for Mem[src]

impl SyncIndex for SFTPIndex[src]

impl<F: Read + Write + Seek + 'static> SyncIndex for GenericFlatFile<F>[src]

fn lookup_chunk(&mut self, id: ChunkID) -> Option<SegmentDescriptor>[src]

Simply looks up the chunk in the cached index map

fn set_chunk(&mut self, id: ChunkID, location: SegmentDescriptor) -> Result<()>[src]

Updates the cached index map, as well as adds the chunk to the EntryFooterData

Errors

Will return Err if the Chunk had not been previously written with write_chunk, and thus has an unknown length.

fn known_chunks(&mut self) -> HashSet<ChunkID>[src]

Collects the keys from the cached index map into a HashSet

fn commit_index(&mut self) -> Result<()>[src]

Flush the EntryFooterDisk to disk and make a new one

fn chunk_count(&mut self) -> usize[src]

Returns the size of the cached index map

Loading content...