pub struct Candidate<'a> {
pub relative: &'a Path,
pub name: &'a str,
pub kind: EntryKind,
pub bytes: u64,
pub allocated: u64,
pub mtime_ns: i64,
pub ignored: bool,
}Expand description
The facts about one entry that selection examines.
Passing a small explicit record rather than an index handle keeps the predicate pure and trivially testable, and keeps selection from reaching into index internals.
relative and name carry one spelling of the entry, and every name-shaped predicate
– globs, exact names, extensions, terminal suffixes, ancestor names – is evaluated
against that spelling. A one-shot report and a watch use the native path. An opened-root
read uses the portable path a page returns, so a caller filters by the names it was
shown: see EntrySelection.
Fields§
§relative: &'a PathPath relative to the index root, in the spelling the selection is evaluated in.
name: &'a strFinal path component, in the same spelling as relative.
kind: EntryKindWhat the entry is.
bytes: u64Apparent size in bytes.
allocated: u64Allocated size in bytes.
mtime_ns: i64Modification time in nanoseconds since the Unix epoch.
ignored: boolWhether a .gitignore rule ignores the entry, or an ancestor of it.
false in an index that observed no control state, where no selection by it is
accepted.