pub struct ParallelWalker { /* private fields */ }Expand description
A breadth-oriented parallel walker for wide repository trees.
Top-level directories are distributed across bounded serial walkers. This
keeps the serial Walker API streaming and gives broad trees an explicit
parallel mode without making scanner output order nondeterministic.
Worker completion order does not affect report order. Callers that need a
cross-filesystem stable manifest must still sort, as Scanner does.
Link-following falls back to the serial walker so cycle detection has one
authoritative seen set.
Implementations§
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.