pub enum Tier {
Named,
Ignored,
}Expand description
Which tier claimed a directory.
The asymmetry is information rather than an accident of implementation: a named row is a directory whose cost to lose is known, and an unnamed one is a leap. That is worth being able to filter on in both directions.
Variants§
Named
A rule named it, so it carries an ecosystem and a Kind.
Ignored
Only the gitignore fallback found it. Nothing knows what it is.
Implementations§
Source§impl Tier
impl Tier
Sourcepub fn of(hit: &Hit) -> Option<Self>
pub fn of(hit: &Hit) -> Option<Self>
Which member of the tier axis judges this hit, or None when the files axis does.
An Option rather than a third value, and that shape is the finding rather than a
detail. A gitignored file is claimed by tier two, so a three-valued tier reads
naturally — but it would then have to move when Preset::All widens, and every
preset moves exactly one axis per step. Files are therefore orthogonal to both axes,
exactly as the / pattern is, and this says so by declining to answer rather than by
answering Ignored and leaving a caller to remember not to ask.
It also no longer reads the kind, which it used to: a kind used to imply a rule, and since a gitignored file can carry one it does not.
Trait Implementations§
impl Copy for Tier
impl Eq for Tier
impl StructuralPartialEq for Tier
Auto Trait Implementations§
impl Freeze for Tier
impl RefUnwindSafe for Tier
impl Send for Tier
impl Sync for Tier
impl Unpin for Tier
impl UnsafeUnpin for Tier
impl UnwindSafe for Tier
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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