Skip to main content

PathClass

Enum PathClass 

Source
pub enum PathClass {
    Extract,
    Opaque,
    Excluded,
}
Expand description

How much of a path the scan may read — the three states, most permissive first.

Ordered by how much each admits, so the ExtractOpaqueExcluded progression reads as a narrowing. See the module docs for which decision needs which.

§Deliberately closed, and not #[non_exhaustive]

The attribute would push a downstream matcher onto a _ => wildcard arm, which is the precise thing this type exists to prevent. Every reader of repository bytes asks PathClass::mines or PathClass::reads; a fourth class is a claim that some reader should treat some path a fourth way, and every such reader has to reconsider when one arrives. A wildcard arm is how that reconsideration gets skipped silently — the same argument rto_exec’s Gate is closed on, where folding NotRun into a wildcard is the defect its third state exists to catch.

The set is three because the fourth candidate is already taken: in the graph, mined, but muted from the reports is [debt] ignore, and reproducing it here is what issue #840 was raised against. Adding a variant is breaking for this published crate, and under AGENTS.md’s rto-* carve-out that ships as a minor — so the cost of getting it wrong later is a compile error at every call site, which is exactly the price this type wants paid.

Variants§

§

Extract

Extract normally: every extractor, every miner, content capture, markers. The default for every path a policy does not name.

§

Opaque

A file node and nothing else — identity without content. No config-key mining, no symbols, no image/audio facts, no marker scan, no meta.content, and the authored classifier declines it.

§

Excluded

Not in the graph at all. No node is produced and the bytes are never read, so nothing a screen would have caught can reach the store by this route either.

Implementations§

Source§

impl PathClass

Source

pub const fn as_str(self) -> &'static str

The class’s name, as roteiro config and a node’s meta.scan spell it.

Source

pub const fn mines(self) -> bool

Whether a reader may derive anything beyond a file’s identity from this path: config keys, symbols, markers, annotations, content.

The question every miner asks. It is deliberately not == Extract spelled out at each call site: a fourth class added later must make every miner reconsider, and a named predicate is where that reconsideration lands.

Source

pub const fn reads(self) -> bool

Whether the bytes at this path are read at all.

false only for PathClass::Excluded. An PathClass::Opaque path is read — its length and line count are facts about it — but nothing is derived from what the bytes say.

Trait Implementations§

Source§

impl Clone for PathClass

Source§

fn clone(&self) -> Self

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 PathClass

Source§

impl Debug for PathClass

Source§

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

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

impl Default for PathClass

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for PathClass

Source§

impl Hash for PathClass

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PathClass

Source§

fn eq(&self, other: &Self) -> 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 PathClass

Auto Trait Implementations§

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<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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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

Checks if this value is equivalent to the given key. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.