pub struct IndexFilter { /* private fields */ }Expand description
Decides which repo-relative paths are eligible for indexing.
Implementations§
Source§impl IndexFilter
impl IndexFilter
Sourcepub fn new(include: &[String]) -> Self
pub fn new(include: &[String]) -> Self
Build a filter whose include entries are repo-relative path prefixes
that override the built-in skip rules.
Sourcepub fn is_indexable(&self, rel: &str) -> bool
pub fn is_indexable(&self, rel: &str) -> bool
Whether rel passes the path-only rules: dependency/output directories,
hidden directories, and generated-file suffixes.
This deliberately says nothing about .gitignore. The incremental driver
does not need it — git2’s diff already omits ignored files — and the
full walk applies it separately in [source_files], where a repository
is open. Keeping gitignore out of the --include override also keeps the
reproducibility guarantee intact: no flag can pull build output into a
view.
Sourcepub fn should_descend(&self, rel: &str) -> bool
pub fn should_descend(&self, rel: &str) -> bool
Whether the walk must descend into directory rel.
Wider than is_indexable: a directory that is
itself skipped must still be entered when an --include path lives
underneath it, or the override can never take effect —
--include vendor/mylib is useless if vendor/ is pruned first.
Trait Implementations§
Source§impl Clone for IndexFilter
impl Clone for IndexFilter
Source§fn clone(&self) -> IndexFilter
fn clone(&self) -> IndexFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more