Skip to main content

MultiScanner

Struct MultiScanner 

Source
pub struct MultiScanner { /* private fields */ }
Expand description

Scans independent roots concurrently while preserving report order.

Implementations§

Source§

impl MultiScanner

Source

pub fn new(root: impl Into<PathBuf>) -> Self

Source

pub fn add_root(self, root: impl Into<PathBuf>) -> Self

Source

pub fn options(self, options: ScanOptions) -> Self

Source

pub const fn with_root_parallelism(self, parallelism: usize) -> Self

Sets concurrent root scans. Zero selects bounded available parallelism.

Source

pub fn runtime(self, runtime: ParallelRuntime) -> Self

Selects the executor shared by parallel discovery in every root.

Source

pub fn scan(self) -> Result<MultiScanReport>

Scans all roots concurrently and returns them in insertion order.

§Errors

Returns the first error in insertion order after all already-started root scans have joined.

§Panics

Panics if an internal root worker panics.

Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.