pub enum GitTrackedMode {
Off,
FileOnly,
DirAware,
}Expand description
How a rule narrows its iteration to git-tracked entries.
Returned by Rule::git_tracked_mode; the engine reads
this at construction time to pick the right pre-filtered
FileIndex (file-only or dir-aware) for each opted-in
rule.
The mode is per-rule (a config might opt in some rules and not others). The engine builds at most two filtered indexes per run regardless of how many rules opt in, so the cost amortises across the whole rule set.
See docs/design/v0.9/git-tracked-filtered-index.md for
the v0.9.11 structural fix this enum is the entry point of.
Variants§
Off
Rule does not consult the git-tracked set. Engine
routes the rule’s evaluation against the unfiltered
FileIndex. The default; do not override unless the
rule opts into git_tracked_only:.
FileOnly
Rule iterates files (ctx.index.files()) and the
engine narrows that to entries where
git_tracked.contains(path) before the rule sees them.
File-mode existence rules (file_exists, file_absent)
pick this mode when the spec’s git_tracked_only: true.
DirAware
Rule iterates dirs (ctx.index.dirs()) and the engine
narrows that to dirs where
dir_has_tracked_files(path, &git_tracked). Dir-mode
existence rules (dir_exists, dir_absent) pick this
mode when the spec’s git_tracked_only: true. The
filtered index also includes the tracked files
themselves so a dir_* rule’s nested per-file checks
(e.g. paths: glob) still match.
Trait Implementations§
Source§impl Clone for GitTrackedMode
impl Clone for GitTrackedMode
Source§fn clone(&self) -> GitTrackedMode
fn clone(&self) -> GitTrackedMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GitTrackedMode
impl Debug for GitTrackedMode
Source§impl PartialEq for GitTrackedMode
impl PartialEq for GitTrackedMode
Source§fn eq(&self, other: &GitTrackedMode) -> bool
fn eq(&self, other: &GitTrackedMode) -> bool
self and other values to be equal, and is used by ==.impl Copy for GitTrackedMode
impl Eq for GitTrackedMode
impl StructuralPartialEq for GitTrackedMode
Auto Trait Implementations§
impl Freeze for GitTrackedMode
impl RefUnwindSafe for GitTrackedMode
impl Send for GitTrackedMode
impl Sync for GitTrackedMode
impl Unpin for GitTrackedMode
impl UnsafeUnpin for GitTrackedMode
impl UnwindSafe for GitTrackedMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more