Skip to main content

ParallelMultiWalker

Struct ParallelMultiWalker 

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

Walks independent raw roots concurrently while preserving root order.

Implementations§

Source§

impl ParallelMultiWalker

Source

pub fn visit<F>(self, visitor: F) -> Result<ParallelMultiVisitReport, WalkError>
where F: for<'entry> Fn(ParallelMultiWalkEvent<'entry>) -> WalkControl + Send + Sync + 'static,

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.

Source

pub fn visit_with_cancellation<F>( self, cancellation: &CancellationToken, visitor: F, ) -> Result<ParallelMultiVisitReport, WalkError>
where F: for<'entry> Fn(ParallelMultiWalkEvent<'entry>) -> WalkControl + Send + Sync + 'static,

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

Source

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

Source

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

Source

pub const fn options(self, options: WalkOptions) -> Self

Source

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

Sets concurrently active roots. Zero uses available parallelism.

Source

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

Sets directory workers requested by each active root.

Source

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

Selects the executor shared by all active roots.

Source

pub const fn skip_stdout(self, enabled: bool) -> Self

Skips a regular file that refers to redirected standard output.

Source

pub fn walk(self) -> Result<ParallelMultiWalkReport, WalkError>

Walks every root and returns reports in insertion order.

§Errors

Returns the first root error in insertion order after all started root workers have joined.

§Panics

Panics if an internal root worker panics.

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.