pub struct ChunkIndex {
pub directory: PathBuf,
pub storage: Arc<dyn ChunkStorage>,
pub lock: Arc<RwLock>,
/* private fields */
}Fields§
§directory: PathBuf§storage: Arc<dyn ChunkStorage>§lock: Arc<RwLock>Implementations§
Source§impl ChunkIndex
impl ChunkIndex
pub fn new( directory: PathBuf, chunk_size: usize, max_chunk_count: usize, storage: Arc<dyn ChunkStorage>, ) -> Self
pub fn open(directory: PathBuf, storage: Arc<dyn ChunkStorage>) -> Result<Self>
pub fn save(&self) -> Result<()>
pub fn references(&self, chunk: &ChunkHash) -> u64
pub fn clean(&self, progress: DeletionProgressCallback) -> Result<()>
pub fn dereference_chunk_id(&self, chunk_id: u64, clean: bool) -> Option<bool>
pub fn read_chunk_id_content( &self, chunk_id: u64, ) -> Result<Box<dyn Read + Send>>
pub fn get_chunk_id(&self, chunk: &ChunkHash) -> Option<u64>
pub fn chunk_file( &self, path: &PathBuf, compression: CompressionFormat, scope: Option<&Scope<'_>>, ) -> Result<Vec<u64>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChunkIndex
impl !RefUnwindSafe for ChunkIndex
impl Send for ChunkIndex
impl Sync for ChunkIndex
impl Unpin for ChunkIndex
impl !UnwindSafe for ChunkIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more