pub struct Deduper {
pub cache: DedupCache,
/* private fields */
}Expand description
Primary deduper: scans a source directory, maintains a chunk cache, and writes deduplicated chunk data to a target location.
Fields§
§cache: DedupCacheImplementations§
Source§impl Deduper
impl Deduper
Sourcepub fn new(
source_path: impl Into<PathBuf>,
cache_paths: Vec<impl Into<PathBuf>>,
hashing_algorithm: HashingAlgorithm,
same_file_system: bool,
) -> Self
pub fn new( source_path: impl Into<PathBuf>, cache_paths: Vec<impl Into<PathBuf>>, hashing_algorithm: HashingAlgorithm, same_file_system: bool, ) -> Self
Initializes a new Deduper:
- Loads provided cache files in reverse order (so later ones override earlier),
- Prunes missing entries,
- Scans the source tree and updates or inserts modified/new files.
Sourcepub fn write_cache(&self)
pub fn write_cache(&self)
Atomically writes the internal cache back to its backing file.
Auto Trait Implementations§
impl Freeze for Deduper
impl !RefUnwindSafe for Deduper
impl Send for Deduper
impl !Sync for Deduper
impl Unpin for Deduper
impl UnwindSafe for Deduper
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