src/backup/datastore.rs: generic index_mark_used_chunks implementation, improve GC stats

This commit is contained in:
Dietmar Maurer
2019-07-04 07:57:43 +02:00
parent 86eda3eb0d
commit a660978c9a
5 changed files with 64 additions and 59 deletions

View File

@ -2,9 +2,13 @@ use failure::*;
use futures::*;
use bytes::{Bytes, BytesMut};
/// Trait to get digest list from index files
///
/// To allow easy iteration over all used chunks.
pub trait IndexFile: Send {
fn index_count(&self) -> usize;
fn index_digest(&self, pos: usize) -> Option<&[u8; 32]>;
fn index_bytes(&self) -> u64;
}
/// Encode digest list from an `IndexFile` into a binary stream