pub struct MultiScanner { /* private fields */ }Expand description
Scans independent roots concurrently while preserving report order.
Implementations§
Source§impl MultiScanner
impl MultiScanner
pub fn new(root: impl Into<PathBuf>) -> Self
pub fn add_root(self, root: impl Into<PathBuf>) -> Self
pub fn options(self, options: ScanOptions) -> Self
Sourcepub const fn with_root_parallelism(self, parallelism: usize) -> Self
pub const fn with_root_parallelism(self, parallelism: usize) -> Self
Sets concurrent root scans. Zero selects bounded available parallelism.
Sourcepub fn runtime(self, runtime: ParallelRuntime) -> Self
pub fn runtime(self, runtime: ParallelRuntime) -> Self
Selects the executor shared by parallel discovery in every root.
Sourcepub fn scan(self) -> Result<MultiScanReport>
pub fn scan(self) -> Result<MultiScanReport>
Sourcepub fn visit_content<Factory, Visitor>(
self,
factory: Factory,
) -> Result<MultiContentVisitReport>where
Factory: Fn(usize, usize) -> Visitor + Send + Sync + 'static,
Visitor: for<'event> FnMut(ContentVisitEvent<'event>) -> ContentVisitControl + Send + 'static,
pub fn visit_content<Factory, Visitor>(
self,
factory: Factory,
) -> Result<MultiContentVisitReport>where
Factory: Fn(usize, usize) -> Visitor + Send + Sync + 'static,
Visitor: for<'event> FnMut(ContentVisitEvent<'event>) -> ContentVisitControl + Send + 'static,
Visits selected content across all roots with globally bounded parallelism and returns root reports in insertion order.
The factory receives (root_index, worker_index) and creates state for
one content worker. Every event carries the same root_index.
ContentVisitControl::Quit cancels work across every root.
§Errors
Returns the first error in root insertion order after all already started root visits have joined.
§Panics
Propagates a panic from a factory or visitor after active root visits observe cancellation.
Sourcepub fn visit_content_streaming<Factory, Visitor>(
self,
factory: Factory,
) -> Result<MultiContentVisitReport>where
Factory: Fn(usize, usize) -> Visitor + Send + Sync + 'static,
Visitor: for<'event> FnMut(ContentVisitEvent<'event>) -> ContentVisitControl + Send + 'static,
pub fn visit_content_streaming<Factory, Visitor>(
self,
factory: Factory,
) -> Result<MultiContentVisitReport>where
Factory: Fn(usize, usize) -> Visitor + Send + Sync + 'static,
Visitor: for<'event> FnMut(ContentVisitEvent<'event>) -> ContentVisitControl + Send + 'static,
Visits content across all roots without retaining selected-file manifests or computing per-root revisions.
§Errors
Returns the same errors as Self::visit_content.