pub struct DirectoryComparer { /* private fields */ }Expand description
A tool for comparing the contents of two directories.
Implementations§
Source§impl DirectoryComparer
impl DirectoryComparer
Sourcepub fn new(dir1: PathBuf, dir2: PathBuf) -> Self
pub fn new(dir1: PathBuf, dir2: PathBuf) -> Self
Creates a new DirectoryComparer for the two given directories.
Sourcepub fn set_max_threads(parallel: usize) -> Result<()>
pub fn set_max_threads(parallel: usize) -> Result<()>
Sets the maximum number of threads for parallel processing. This initializes the global Rayon thread pool.
Sourcepub fn run(dir1: PathBuf, dir2: PathBuf) -> Result<()>
pub fn run(dir1: PathBuf, dir2: PathBuf) -> Result<()>
Executes the directory comparison and prints results to stdout. This is a convenience method for CLI usage.
Sourcepub fn compare_streaming<F>(
&self,
on_total: F,
tx: Sender<FileComparisonResult>,
) -> Result<()>
pub fn compare_streaming<F>( &self, on_total: F, tx: Sender<FileComparisonResult>, ) -> Result<()>
Performs the directory comparison and streams results via a channel.
§Arguments
on_total- A callback triggered with the total number of files to be compared.tx- A sender to transmitFileComparisonResultas they are computed.
Auto Trait Implementations§
impl Freeze for DirectoryComparer
impl RefUnwindSafe for DirectoryComparer
impl Send for DirectoryComparer
impl Sync for DirectoryComparer
impl Unpin for DirectoryComparer
impl UnsafeUnpin for DirectoryComparer
impl UnwindSafe for DirectoryComparer
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