pub struct ParallelWalker { /* private fields */ }Expand description
An adaptive parallel filesystem walker.
Broad root frontiers use low-overhead lane traversal. Narrow trees use dynamic directory scheduling so work below one top-level directory can use every worker. Link-following carries an immutable ancestry set with each directory task so aliases remain parallel without losing cycle detection.
Implementations§
Source§impl ParallelWalker
impl ParallelWalker
Sourcepub fn into_iter_ordered_bounded(self, capacity: usize) -> ParallelWalkIter ⓘ
pub fn into_iter_ordered_bounded(self, capacity: usize) -> ParallelWalkIter ⓘ
Starts bounded parallel traversal and yields entries in strict, deterministic depth-first order.
Directory reads are prefetched up to max_open and the configured
parallelism. A capacity of zero is normalized to one.
§Panics
Panics if the coordinator thread cannot be created. Use
Self::try_into_iter_ordered_bounded for fallible startup.
Sourcepub fn try_into_iter_ordered_bounded(
self,
capacity: usize,
) -> Result<ParallelWalkIter>
pub fn try_into_iter_ordered_bounded( self, capacity: usize, ) -> Result<ParallelWalkIter>
Fallible form of Self::into_iter_ordered_bounded.
§Errors
Returns the coordinator thread spawn error.
Source§impl ParallelWalker
impl ParallelWalker
Sourcepub fn into_iter_bounded(self, capacity: usize) -> ParallelWalkIter ⓘ
pub fn into_iter_bounded(self, capacity: usize) -> ParallelWalkIter ⓘ
Starts parallel traversal with a bounded pull buffer.
A capacity of zero is normalized to one. Workers stop producing when the buffer is full until the consumer requests another item.
§Panics
Panics if the coordinator thread cannot be created. Use
Self::try_into_iter_bounded for fallible startup.
Sourcepub fn try_into_iter_bounded(self, capacity: usize) -> Result<ParallelWalkIter>
pub fn try_into_iter_bounded(self, capacity: usize) -> Result<ParallelWalkIter>
Fallible form of Self::into_iter_bounded.
This reports an operating-system thread creation failure instead of panicking before traversal starts.
§Errors
Returns the coordinator thread spawn error.
Source§impl ParallelWalker
impl ParallelWalker
Sourcepub fn visit<F>(self, visitor: F) -> Result<ParallelVisitReport, WalkError>
pub fn visit<F>(self, visitor: F) -> Result<ParallelVisitReport, WalkError>
Visits entries directly on traversal workers without collecting paths.
Visitor calls may run concurrently and their order is intentionally
unspecified. Use Self::walk when deterministic collected order is
required.
§Errors
Returns a root error or the first traversal error under
ErrorPolicy::Abort.
§Panics
Panics if the visitor or an internal traversal worker panics.
Sourcepub fn visit_with_cancellation<F>(
self,
cancellation: &CancellationToken,
visitor: F,
) -> Result<ParallelVisitReport, WalkError>
pub fn visit_with_cancellation<F>( self, cancellation: &CancellationToken, visitor: F, ) -> Result<ParallelVisitReport, WalkError>
Source§impl ParallelWalker
impl ParallelWalker
pub fn new(root: impl Into<PathBuf>) -> Self
pub const fn options(self, options: WalkOptions) -> Self
Sourcepub const fn with_parallelism(self, parallelism: usize) -> Self
pub const fn with_parallelism(self, parallelism: usize) -> Self
Sets worker count. Zero selects available parallelism.
Sourcepub fn runtime(self, runtime: ParallelRuntime) -> Self
pub fn runtime(self, runtime: ParallelRuntime) -> Self
Selects the global, dedicated, or application-owned executor.
Sourcepub fn skip_stdout(self, enabled: bool) -> Self
pub fn skip_stdout(self, enabled: bool) -> Self
Skips a regular file that refers to redirected standard output.
This applies consistently to collected, visitor and pull APIs and prevents feedback loops when command output is written inside a walked tree.