Trait asuran::repository::backend::Index[][src]

pub trait Index: Send + Sync + Debug + 'static {
    fn lookup_chunk<'life0, 'async_trait>(
        &'life0 mut self,
        id: ChunkID
    ) -> Pin<Box<dyn Future<Output = Option<SegmentDescriptor>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn set_chunk<'life0, 'async_trait>(
        &'life0 mut self,
        id: ChunkID,
        location: SegmentDescriptor
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn known_chunks<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = HashSet<ChunkID>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn commit_index<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn count_chunk<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }
Expand description

Index Trait

Keeps track of where chunks are in the backend

Required methods

Provides the location of a chunk in the repository

Sets the location of a chunk in the repository

Returns the set of all ChunkIDs known to exist in the Asuran repository.

Commits the index

Returns the total number of chunks in the index

Implementors