[−][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 sort(self, sort: bool) -> Self
[src]
Sort entries by file_name
per directory. Defaults to false
. Use
process_entries
for custom
sorting or filtering.
[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 max_depth(self, depth: usize) -> Self
[src]
Maximum depth of entries yielded by the iterator. 0
corresponds to the
root path of this walk.
A depth < 2 will automatically change thread_count
to 1. Parrallelism
happens at the fs::read_dir
level. It only makes sense to use multiple
threads when reading more then one directory.
pub fn num_threads(self, n: usize) -> Self
[src]
0
Use rayon global pool.1
Perform walk on calling thread.n > 1
Construct a new rayon ThreadPool to perform the walk.
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,
A callback function to process (sort/filter/skip) each directory of
entries before they are yeilded. Modify the given array to sort/filter
entries. Use entry.content_spec = None
to yeild an entry but skip
reading its contents.
Trait Implementations
impl IntoIterator for WalkDir
[src]
type Item = Result<DirEntry>
The type of the elements being iterated over.
type IntoIter = DirEntryIter
Which kind of iterator are we turning this into?
ⓘImportant traits for DirEntryIterfn into_iter(self) -> DirEntryIter
[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,