Struct wax::walk::GlobWalker
source · pub struct GlobWalker { /* private fields */ }
walk
only.Expand description
Describes iteration over matching files in a directory tree.
A walker provides the paths walked by a Glob
prior to iteration, most notably the root
path, which may differ from the directory passed to walking
functions. When ready, it can be converted into an iterator over matching files.
See Glob::walker
.
Implementations§
source§impl GlobWalker
impl GlobWalker
sourcepub fn root_prefix_paths(&self) -> (&Path, &Path)
pub fn root_prefix_paths(&self) -> (&Path, &Path)
Gets the root and prefix paths.
The root path is the path to the walked directory tree. This path may differ from the
directory passed to walking functions like Glob::walk
, because it may incorporate an
invariant path prefix from the glob expression.
The prefix path is the invariant path prefix of the glob expression. This path may be empty and is always a suffix of the root path.
The following table describes some example paths when using Glob::walk
.
Glob Expression | Directory | Root | Prefix |
---|---|---|---|
**/*.txt | /home/user | /home/user | |
projects/**/src/**/*.rs | . | ./projects | projects |
/var/log/**/*.log | . | /var/log | /var/log |
See also Entry::root_relative_paths
.
sourcepub fn walk(self) -> impl 'static + FileIterator<Entry = GlobEntry>
pub fn walk(self) -> impl 'static + FileIterator<Entry = GlobEntry>
Converts a walker into an iterator over matching files in its directory tree.
See Glob::walk
.
sourcepub fn walk_with_behavior(
self,
behavior: impl Into<WalkBehavior>
) -> impl 'static + FileIterator<Entry = GlobEntry, Residue = TreeEntry>
pub fn walk_with_behavior( self, behavior: impl Into<WalkBehavior> ) -> impl 'static + FileIterator<Entry = GlobEntry, Residue = TreeEntry>
Converts a walker into an iterator over matching files in its directory tree.
Trait Implementations§
source§impl Clone for GlobWalker
impl Clone for GlobWalker
source§fn clone(&self) -> GlobWalker
fn clone(&self) -> GlobWalker
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more