pub struct Selector {
pub base: PathBuf,
pub names: Option<Vec<Regex>>,
pub types: Vec<EntryType>,
pub size: Option<SizeCmp>,
pub hidden: bool,
pub follow: bool,
pub no_ignore: bool,
}Expand description
Resolved file-selection predicates. Build one, then iterate walk.
Fields§
§base: PathBufTraversal root (a file yields just itself; a directory is descended).
names: Option<Vec<Regex>>Whole-name alternatives; None matches any name.
types: Vec<EntryType>Allowed entry kinds; empty matches any kind.
size: Option<SizeCmp>Size predicate (applies to regular files only).
Include dot-entries and descend dot-directories.
follow: boolFollow symlinks while traversing.
no_ignore: boolWalk every file, ignoring .gitignore/.ignore rules (the .git
directory is always skipped regardless). Default false: like git, the
walk skips what the project has chosen to ignore.
Implementations§
Source§impl Selector
impl Selector
Sourcepub fn walk(&self) -> impl Iterator<Item = Result<DirEntry, String>> + '_
pub fn walk(&self) -> impl Iterator<Item = Result<DirEntry, String>> + '_
Yield every entry under base that passes the
structural predicates (kind, name, size, hidden). By default the walk
honors .gitignore/.ignore (and always skips .git), so a build tree
like target/ is not descended; no_ignore disables that filtering.
Traversal errors and per-entry stat failures surface as Err items
rather than panicking.