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

pub trait Index: Send + Sync + Debug + 'static {
#[must_use]    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
;
#[must_use] 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
;
#[must_use] 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
;
#[must_use] 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
;
#[must_use] 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
; }

Index Trait

Keeps track of where chunks are in the backend

Required methods

#[must_use]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, 

Provides the location of a chunk in the repository

#[must_use]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, 

Sets the location of a chunk in the repository

#[must_use]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, 

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

#[must_use]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, 

Commits the index

#[must_use]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, 

Returns the total number of chunks in the index

Loading content...

Implementors

impl Index for Index[src]

impl Index for IndexObject[src]

impl<B: SyncBackend> Index for BackendHandle<B>[src]

Loading content...