pub enum Kind {
Unrecoverable,
Dependencies,
Build,
Cache,
Noise,
}Expand description
What a reclaimable thing is, from a closed vocabulary ordered by what it costs to lose.
The vocabulary is closed on purpose, and it is the half of a label that a machine can act on: a kind sorts, groups and filters, so “show me every cache” is a question the front end can answer. A free-text sentence never could.
It also carries the cost, which is the one thing the regeneration command it replaced was genuinely for. A cache is free, an output is a compile, dependencies are a network fetch — and unlike a command string, that reading holds without knowing anything about the machine it would be paid on.
§The ordering is the point, and it is Kind::ALL
The three middle members were already ordered — what was fetched, what was compiled, what
will come back on its own — and Kind::ALL is now that ordering made explicit, with a
member at each extreme:
| cost to lose | |
|---|---|
Unrecoverable | nothing brings it back |
Dependencies | a network fetch |
Build | a compile |
Cache | it returns on its own |
Noise | nothing will miss it |
Everything else in the crate reads the order off ALL rather than restating it, so the
confirmation groups the expensive end first and the front end derives a key per member.
§A kind NAMES, it does not gate
Unrecoverable inverts the premise of the rest of the vocabulary —
nothing brings it back — and it is tempting to make the code treat it apart: skip it in a
bulk mark, put a second flag in front of deleting one. That was built and then removed,
and the reason is worth keeping. A mark is a statement about a subtree, and the fractional
glyph on an ancestor is a true reading of how much of it is spoken for; a mark that silently
skipped some descendants would make that glyph describe a set no reader can see, and the
exception would live nowhere a reader could find it.
So the safety is carried entirely by what a view shows, which is a lever the front end
already had: no lens shows gitignored files until i says so, no sweep claims one until
--ignored-files says so, and a mark carries the lens it was made through. Seeing a .env
at all is the deliberate act. After that it is a row like any other — same keys, same rules,
one confirmation that lists the whole batch with the expensive end first.
What the kind still does is name the thing, which is what a label has been for since the
regeneration command was deleted. See Kind::of_ignored_file and super::tui::lens.
Variants§
Unrecoverable
Something nothing regenerates: an .env, a private key, a credentials file.
A rule may declare it — a secrets/ directory somebody’s own ruleset names is exactly
as unrecoverable as a .env — but nothing in the shipped ruleset does, because the
evidence a marker-anchored rule offers is “this project is of that type” rather than
“this file is the only copy”.
Dependencies
Installed third-party code: node_modules, .venv, vendor.
Build
Compiled output: target, bin, obj, dist.
Cache
Regenerated automatically: __pycache__, .nx/cache, .gradle, .ipynb_checkpoints.
Noise
Written by something nobody asked, and read by nothing: *.log, .DS_Store,
Thumbs.db. The cheapest thing here to lose.
Implementations§
Source§impl Kind
impl Kind
Sourcepub const ALL: [Self; 5]
pub const ALL: [Self; 5]
The whole vocabulary, in order of what it costs to lose: what nothing brings back, what was fetched, what was compiled, what will come back on its own, what nothing will miss.
Being able to enumerate it is half of what “closed” buys — the front end derives a key and a help sentence per kind from this rather than listing them again, and the confirmation’s grouping is this order, so a sixth kind would arrive already filterable and already sorted.
Sourcepub fn cost(self) -> usize
pub fn cost(self) -> usize
Where this kind sits on the cost axis, counting from the expensive end.
Read off Kind::ALL rather than written out a second time, because a listing that
grouped in one order while the help page named them in another would be two claims
about one vocabulary.
Sourcepub fn of_ignored_file(name: &str) -> Option<Self>
pub fn of_ignored_file(name: &str) -> Option<Self>
What the name of a gitignored file says it is, or None when the name says
nothing.
This is a claim about a name and not about contents, which is why the two ends of the
vocabulary are the only ones it can reach: .env and id_rsa are the only copy of
something, *.log and .DS_Store are the copy of nothing. A name that says neither
gets None and reads as the tier-two directory claim already does — git knows the file
is disposable and nothing knows what it is.
Matched against the lowercased name, because .DS_Store and Thumbs.db are written
both ways by the systems that create them and the case is not information.
Sourcepub fn cost_said(self) -> &'static str
pub fn cost_said(self) -> &'static str
What losing one of these costs, said out loud.
The vocabulary’s whole content in one sentence per member, which is what the help page
and the confirmation print. Unrecoverable is not decoration and a reader has to be
able to find out what it means without reading this file.
Trait Implementations§
impl Copy for Kind
Source§impl<'de> Deserialize<'de> for Kind
impl<'de> Deserialize<'de> for Kind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Kind
impl StructuralPartialEq for Kind
Auto Trait Implementations§
impl Freeze for Kind
impl RefUnwindSafe for Kind
impl Send for Kind
impl Sync for Kind
impl Unpin for Kind
impl UnsafeUnpin for Kind
impl UnwindSafe for Kind
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more