pub struct ConcurrentRunner<Config> { /* private fields */ }
Expand description
A runner to process files concurrently.
Implementations§
Source§impl<Config: 'static + Send + Sync> ConcurrentRunner<Config>
impl<Config: 'static + Send + Sync> ConcurrentRunner<Config>
Sourcepub fn new<ProcFiles>(num_jobs: usize, proc_files: ProcFiles) -> Self
pub fn new<ProcFiles>(num_jobs: usize, proc_files: ProcFiles) -> Self
Creates a new ConcurrentRunner
.
num_jobs
- Number of jobs utilized to process files concurrently.proc_files
- Function that processes each file found during the search.
Sourcepub fn set_proc_dir_paths<ProcDirPaths>(
self,
proc_dir_paths: ProcDirPaths,
) -> Self
pub fn set_proc_dir_paths<ProcDirPaths>( self, proc_dir_paths: ProcDirPaths, ) -> Self
Sets the function to process the paths and subpaths contained in a directory.
Sourcepub fn set_proc_path<ProcPath>(self, proc_path: ProcPath) -> Self
pub fn set_proc_path<ProcPath>(self, proc_path: ProcPath) -> Self
Sets the function to process a single path.
Sourcepub fn run(
self,
config: Config,
files_data: FilesData,
) -> Result<HashMap<String, Vec<PathBuf>>, ConcurrentErrors>
pub fn run( self, config: Config, files_data: FilesData, ) -> Result<HashMap<String, Vec<PathBuf>>, ConcurrentErrors>
Runs the producer-consumer approach to process the files contained in a directory and in its own subdirectories.
config
- Information used to process a file.files_data
- Information about the files to be included or excluded from a search more the number of paths considered in the search.
Auto Trait Implementations§
impl<Config> Freeze for ConcurrentRunner<Config>
impl<Config> !RefUnwindSafe for ConcurrentRunner<Config>
impl<Config> Send for ConcurrentRunner<Config>
impl<Config> Sync for ConcurrentRunner<Config>
impl<Config> Unpin for ConcurrentRunner<Config>
impl<Config> !UnwindSafe for ConcurrentRunner<Config>
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