Skip to main content

AnalysisView

Struct AnalysisView 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§full: &'a AnalysisResult

Borrows 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: ViewSpec

The spec that produced this view (echoed for JSON consumers).

§eligible_count: usize

Post-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: bool

True 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: AnalysisSummary

Summary 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.

Trait Implementations§

Source§

impl<'a> Debug for AnalysisView<'a>

Source§

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

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

impl<'a> Serialize for AnalysisView<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for AnalysisView<'a>

§

impl<'a> RefUnwindSafe for AnalysisView<'a>

§

impl<'a> Send for AnalysisView<'a>

§

impl<'a> Sync for AnalysisView<'a>

§

impl<'a> Unpin for AnalysisView<'a>

§

impl<'a> UnsafeUnpin for AnalysisView<'a>

§

impl<'a> UnwindSafe for AnalysisView<'a>

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> 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.