pub struct ParallelMultiWalker { /* private fields */ }Expand description
Walks independent raw roots concurrently while preserving root order.
Implementations§
Source§impl ParallelMultiWalker
impl ParallelMultiWalker
Sourcepub fn visit<F>(self, visitor: F) -> Result<ParallelMultiVisitReport, WalkError>
pub fn visit<F>(self, visitor: F) -> Result<ParallelMultiVisitReport, WalkError>
Streams every configured root through one concurrent callback.
Callback order is intentionally unspecified. Each event carries its
root insertion index, while the returned per-root reports preserve
insertion order. WalkControl::Quit cancels every active root.
§Errors
Returns the first root error in insertion order after all started root workers have joined.
§Panics
Panics if the callback or an internal root worker panics.
Sourcepub fn visit_with_cancellation<F>(
self,
cancellation: &CancellationToken,
visitor: F,
) -> Result<ParallelMultiVisitReport, WalkError>
pub fn visit_with_cancellation<F>( self, cancellation: &CancellationToken, visitor: F, ) -> Result<ParallelMultiVisitReport, WalkError>
Multi-root streaming traversal with shared cooperative cancellation.
Returning WalkControl::Quit cancels the supplied token so every
active and not-yet-started root observes the same stop request.
§Errors
Returns the first root error in insertion order after all started root workers have joined.
§Panics
Panics if the callback or an internal root worker panics.
Source§impl ParallelMultiWalker
impl ParallelMultiWalker
pub fn new(root: impl Into<PathBuf>) -> Self
pub fn add_root(self, root: impl Into<PathBuf>) -> Self
pub const fn options(self, options: WalkOptions) -> Self
Sourcepub const fn with_root_parallelism(self, parallelism: usize) -> Self
pub const fn with_root_parallelism(self, parallelism: usize) -> Self
Sets concurrently active roots. Zero uses available parallelism.
Sourcepub const fn with_traversal_parallelism(self, parallelism: usize) -> Self
pub const fn with_traversal_parallelism(self, parallelism: usize) -> Self
Sets directory workers requested by each active root.
Sourcepub fn runtime(self, runtime: ParallelRuntime) -> Self
pub fn runtime(self, runtime: ParallelRuntime) -> Self
Selects the executor shared by all active roots.
Sourcepub const fn skip_stdout(self, enabled: bool) -> Self
pub const fn skip_stdout(self, enabled: bool) -> Self
Skips a regular file that refers to redirected standard output.