pub struct Hydrator {
pub cache: DedupCache,
/* private fields */
}Expand description
Rebuilds original files from deduplicated chunk storage using a cache.
Fields§
§cache: DedupCacheImplementations§
Source§impl Hydrator
impl Hydrator
Sourcepub fn new(
source_path: impl Into<PathBuf>,
cache_paths: Vec<impl Into<PathBuf>>,
) -> Self
pub fn new( source_path: impl Into<PathBuf>, cache_paths: Vec<impl Into<PathBuf>>, ) -> Self
Loads the cache(s) and prepares for hydration.
Sourcepub fn restore_files(
&self,
target_path: impl Into<PathBuf>,
declutter_levels: usize,
)
pub fn restore_files( &self, target_path: impl Into<PathBuf>, declutter_levels: usize, )
Restores files into target_path by concatenating their chunks. declutter_levels must
match the level used during deduplication.
Sourcepub fn list_missing_chunks(
&self,
declutter_levels: usize,
) -> impl Iterator<Item = (PathBuf, String)>
pub fn list_missing_chunks( &self, declutter_levels: usize, ) -> impl Iterator<Item = (PathBuf, String)>
List missing chunks or chunks with wrong size.
Sourcepub fn check_cache(&self, declutter_levels: usize) -> bool
pub fn check_cache(&self, declutter_levels: usize) -> bool
Check if all chunk files listed in the cache are present in source directory.
Sourcepub fn list_extra_files(
&self,
declutter_levels: usize,
) -> impl Iterator<Item = PathBuf>
pub fn list_extra_files( &self, declutter_levels: usize, ) -> impl Iterator<Item = PathBuf>
List files in source directory that are not listed in cache.
Sourcepub fn delete_extra_files(&self, declutter_levels: usize) -> Result<()>
pub fn delete_extra_files(&self, declutter_levels: usize) -> Result<()>
Delete files in source directory that are not listed in cache.
Auto Trait Implementations§
impl Freeze for Hydrator
impl !RefUnwindSafe for Hydrator
impl Send for Hydrator
impl !Sync for Hydrator
impl Unpin for Hydrator
impl UnwindSafe for Hydrator
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> 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