[−][src]Struct jwalk::WalkDir
Builder for walking a directory.
Methods
impl WalkDir[src]
pub fn new<P: AsRef<Path>>(root: P) -> Self[src]
Create a builder for a recursive directory iterator starting at the file path root. If root is a directory, then it is the first item yielded by the iterator. If root is a file, then it is the first and only item yielded by the iterator.
pub fn max_depth(self, depth: usize) -> Self[src]
Set the maximum depth of entries yield by the iterator.
The smallest depth is 0 and always corresponds to the path given to the
new function on this type. Its direct descendents have depth 1, and
their descendents have depth 2, and so on.
Note that a depth < 2 will automatically change thread_count to 1.
jwalks parrallelism happens at the fs::read_dir level, so it only
makes sense to use multiple threads when reading more then one directory.
pub fn sort(self, sort: Option<Sort>) -> Self[src]
Sort entries per directory. Use
process_entries for custom
sorting or filtering.
pub fn num_threads(self, n: usize) -> Self[src]
0Use rayon global pool.1Perform walk on calling thread.n > 1Construct a new rayon ThreadPool to perform the walk.
[src]
Skip hidden entries. Enabled by default.
pub fn preload_metadata(self, preload_metadata: bool) -> Self[src]
Preload metadata before yeilding entries. When running in parrallel the metadata is loaded in rayon's thread pool.
pub fn process_entries<F>(self, process_by: F) -> Self where
F: Fn(&mut Vec<Result<DirEntry>>) + Send + Sync + 'static, [src]
F: Fn(&mut Vec<Result<DirEntry>>) + Send + Sync + 'static,
Set a function to process (sort/filter/skip) each directory of entries
before they are yeilded. Use
entry.set_children_spec(None)
to yeild that directory but skip descending into its contents.
Trait Implementations
impl IntoIterator for WalkDir[src]
Auto Trait Implementations
Blanket Implementations
impl<I> IntoIterator for I where
I: Iterator, [src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> From for T[src]
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,