pub struct Selection {Show 13 fields
pub include: Vec<Pattern>,
pub exclude: Vec<Pattern>,
pub min_size: Option<u64>,
pub kinds: Vec<EntryKind>,
pub modified: ModifiedWindow,
pub ignored: IgnoredEntries,
pub depth: Option<Bound>,
pub min_share: Option<ShareThreshold>,
pub breadth: Option<Bound>,
pub limit: Option<Bound>,
pub sort: Option<SortKey>,
pub reverse: bool,
pub size: SizeMetric,
}Expand description
Which retained entries a query considers, and how its results are shaped.
Fields§
§include: Vec<Pattern>Patterns an entry must match at least one of, when non-empty.
exclude: Vec<Pattern>Patterns that exclude an entry outright; exclusion wins over inclusion.
min_size: Option<u64>Smallest size, in the selected metric, an entry may have.
kinds: Vec<EntryKind>Entry kinds to consider; empty means every kind.
modified: ModifiedWindowModification-time window.
ignored: IgnoredEntriesEntries to consider by .gitignore classification.
Anything but IgnoredEntries::Include needs an index that observed control
state; crate::query::Request::validate refuses it otherwise.
depth: Option<Bound>How deep a rendered tree descends, or None to let each view apply its own.
Optional for the same reason limit and sort are. The depth that suits a tree
is not the depth that suits a flat enumeration, and while this was a plain
Bound the only default the library could offer was “unbounded” – so the CLI
declared default_value = "2" itself and every other caller silently got a
different report for the same request.
Minimum displayed share of the selected root, as an exact percentage.
breadth: Option<Bound>Maximum immediate child rows displayed per directory.
limit: Option<Bound>How many entries a view reports.
Rows to keep, or None to let each view apply its own bound.
Optional for the same reason sort is: a bound that suits a per-directory tree
is not the bound that suits a complete enumeration, and a single shared default
produced “the ten alphabetically-first entries” of a 192,871-entry tree.
sort: Option<SortKey>Ordering key, or None to let each view apply its own default.
Optional rather than defaulted here because the sensible default differs by view: a tree and a type breakdown rank by size, while a flat file listing reads in name order. One shared default would be wrong for one of them.
reverse: boolWhether the ordering is reversed.
size: SizeMetricWhich size metric the report answers in.
Implementations§
Source§impl Selection
impl Selection
Sourcepub fn is_unfiltered(&self) -> bool
pub fn is_unfiltered(&self) -> bool
Whether this selection constrains which entries are considered.
An unconstrained selection lets a view read pre-computed roll-up state directly instead of traversing entries, which is the difference between the two performance tiers a report can run in.