pub struct WalkBuilder { /* private fields */ }Expand description
Configures and executes a recursive directory walk.
let result = WalkBuilder::new("/some/path")
.max_depth(3)
.hidden(true)
.build()
.unwrap();Implementations§
Source§impl WalkBuilder
impl WalkBuilder
pub fn new(root: impl AsRef<Path>) -> Self
pub fn max_depth(self, depth: u32) -> Self
pub fn follow_links(self, follow: bool) -> Self
pub fn stats(self, compute: bool) -> Self
pub fn extensions(self, exts: impl IntoIterator<Item = impl AsRef<str>>) -> Self
pub fn glob(self, pattern: &str) -> Result<Self, Error>
pub fn min_size(self, size: u64) -> Self
pub fn max_size(self, size: u64) -> Self
pub fn gitignore(self, enabled: bool) -> Self
pub fn sort(self, sort: Sort) -> Self
pub fn dirs_first(self, enabled: bool) -> Self
pub fn threads(self, spec: impl Into<Threads>) -> Self
Sourcepub fn storage_hint(self, hint: StorageHint) -> Self
pub fn storage_hint(self, hint: StorageHint) -> Self
Hint about the storage medium being walked.
Defaults to StorageHint::Local. See StorageHint for details.
Sourcepub fn pool(self, pool: Arc<ThreadPool>) -> Self
pub fn pool(self, pool: Arc<ThreadPool>) -> Self
Provide a pre-built rayon thread pool for parallel walks.
Eliminates per-walk pool creation overhead — useful when calling in a tight loop
(e.g. benchmarks). Has no effect on single-threaded walks.
When a pool is provided, the pool’s own thread count is used; .threads() is ignored.
pub fn build(self) -> Result<WalkResult, Error>
pub fn iter(self) -> Result<WalkIter, Error>
Auto Trait Implementations§
impl Freeze for WalkBuilder
impl !RefUnwindSafe for WalkBuilder
impl Send for WalkBuilder
impl Sync for WalkBuilder
impl Unpin for WalkBuilder
impl UnsafeUnpin for WalkBuilder
impl !UnwindSafe for WalkBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more