#[non_exhaustive]pub struct AnalysisView<'a> {
pub full: &'a AnalysisResult,
pub spec: ViewSpec,
pub eligible_count: usize,
pub truncated: bool,
pub shown: Vec<&'a FunctionVerdict>,
pub shown_summary: AnalysisSummary,
pub grouped: Option<GroupedView>,
}Expand description
The shaped result of applying a ViewSpec to an AnalysisResult.
full is borrow-only and elided from JSON output (the envelope’s
result field already carries the same data). All shaping happens
over shown; eligible_count is the post-filter, pre-truncate
count; truncated records whether limit reduced the row set.
Gate keystone: exit-code logic must derive from
view.full.passed, never from view.shown or
view.shown_summary. Reporters consult should_render_view_line
to decide whether to emit a “View:” subtitle for the shaped output.
#[non_exhaustive] reserves namespace for future per-view aggregates
(e.g., per-risk-bucket counts, per-module fan-in) without breaking
downstream pattern matches.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.full: &'a AnalysisResultBorrows the original analysis. #[serde(skip)] because the
envelope’s result already serializes the full analysis.
Gate source of truth — exit-code logic uses full.passed.
spec: ViewSpecThe spec that produced this view (echoed for JSON consumers).
eligible_count: usizePost-filter, pre-truncate row count. When grouping is active,
this is the function-level eligible count; the file-level
equivalent lives in GroupedView::eligible_count.
truncated: boolTrue iff limit dropped function-level rows. When grouping is
active, this is forced false (the function-level row list is
not truncated under grouping); see GroupedView::truncated.
shown: Vec<&'a FunctionVerdict>Borrow vector over the shaped function rows. Order, count, and
truncation depend on spec.
shown_summary: AnalysisSummarySummary computed over shown only — useful for reporters that
want a “selected subset” header. Not the gate source: use
full.summary and full.passed for verdict logic.
grouped: Option<GroupedView>Optional parallel grouping. Present iff spec.group_by.is_some().
When set, shown retains the un-truncated eligible function
rows (drill-down ergonomics) and grouped.files carries the
post-sort, post-truncate file list.