Skip to main content

Kind

Enum Kind 

Source
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
Unrecoverablenothing brings it back
Dependenciesa network fetch
Builda compile
Cacheit returns on its own
Noisenothing 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

Source

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.

Source

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.

Source

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.

Source

pub fn short(self) -> &'static str

One word, for somewhere with no room for the whole label.

Source

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§

Source§

impl Clone for Kind

Source§

fn clone(&self) -> Kind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Kind

Source§

impl Debug for Kind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Kind

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Kind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Kind

Source§

impl PartialEq for Kind

Source§

fn eq(&self, other: &Kind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToCompactString for T
where T: Display,

Source§

impl<T> ToLine for T
where T: Display,

Source§

fn to_line(&self) -> Line<'_>

Converts the value to a Line.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToSpan for T
where T: Display,

Source§

fn to_span(&self) -> Span<'_>

Converts the value to a Span.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToText for T
where T: Display,

Source§

fn to_text(&self) -> Text<'_>

Converts the value to a Text.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.