pub struct CountQuerySet {
pub aggregation: Aggregation,
pub line_types: LineTypes,
pub items: Vec<QueryItem<Locs>>,
pub total: Locs,
pub file_count: usize,
pub total_items: usize,
pub top_applied: bool,
}Expand description
Query set for count results.
Fields§
§aggregation: AggregationAggregation level used
line_types: LineTypesLine types included
items: Vec<QueryItem<Locs>>Data rows (filtered and sorted; possibly truncated by top)
total: LocsTotal across all items in the underlying data set (not affected by top or filter)
file_count: usizeNumber of files analyzed
total_items: usizeCount of rows before any user-driven reduction (top or filter).
Equals items.len() unless one of those was applied.
top_applied: boolTrue iff top was applied. Distinguishes top-truncation from
filter-elimination so the footer can render “top X of Y” vs plain
“X of Y” appropriately.
Implementations§
Source§impl CountQuerySet
impl CountQuerySet
Sourcepub fn from_result(
result: &CountResult,
aggregation: Aggregation,
line_types: LineTypes,
ordering: Ordering,
) -> Self
pub fn from_result( result: &CountResult, aggregation: Aggregation, line_types: LineTypes, ordering: Ordering, ) -> Self
Create a QuerySet from a CountResult.
Applies aggregation level, line type filters, and ordering.
Sourcepub fn top(self, n: usize) -> Self
pub fn top(self, n: usize) -> Self
Keep only the first n items after ordering.
Applied after from_result so the truncation runs on already-sorted
rows. With n larger than the current row count this is a no-op.
total and file_count are intentionally not changed — the displayed
rows are a slice, but the underlying counts still describe the full
data set.
Sourcepub fn filter(self, preds: &[Predicate]) -> Self
pub fn filter(self, preds: &[Predicate]) -> Self
Keep only items satisfying every predicate (AND-combined).
Field::Total honors the active LineTypes — i.e. the total used
here is the same one that Ordering with OrderBy::Total uses, so
--type code,tests --total-gte 1000 filters on the sum of the two
enabled types, not on the precomputed Locs::total.
total_items is intentionally NOT updated — it tracks the row count
before any user-driven truncation (top and filter), so the
footer can render “top X of Y” honestly even when the visible slice
is filtered down. The full data set is still summarized in total.
Trait Implementations§
Source§impl Clone for CountQuerySet
impl Clone for CountQuerySet
Source§fn clone(&self) -> CountQuerySet
fn clone(&self) -> CountQuerySet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more