Skip to main content

ViewApp

Struct ViewApp 

Source
pub struct ViewApp {
Show 28 fields pub sbom: NormalizedSbom, pub active_tab: ViewTab, pub tree_state: TreeState, pub tree_group_by: TreeGroupBy, pub tree_filter: TreeFilter, pub tree_search_query: String, pub tree_search_active: bool, pub selected_component: Option<String>, pub component_tab: ComponentDetailTab, pub vuln_state: VulnExplorerState, pub license_state: LicenseViewState, pub dependency_state: DependencyViewState, pub search_state: SearchState, pub focus_panel: FocusPanel, pub show_help: bool, pub show_export: bool, pub show_legend: bool, pub status_message: Option<String>, pub navigation_ctx: ViewNavigationContext, pub should_quit: bool, pub tick: u64, pub stats: SbomStats, pub quality_report: QualityReport, pub quality_state: QualityViewState, pub compliance_results: Option<Vec<ComplianceResult>>, pub compliance_state: StandardComplianceState, pub sbom_index: NormalizedSbomIndex, pub source_state: SourcePanelState,
}
Expand description

Main application state for single SBOM viewing.

Fields§

§sbom: NormalizedSbom

The SBOM being viewed

§active_tab: ViewTab

Current active view/tab

§tree_state: TreeState

Tree navigation state

§tree_group_by: TreeGroupBy

Current tree grouping mode

§tree_filter: TreeFilter

Current tree filter

§tree_search_query: String

Tree search query (inline filter)

§tree_search_active: bool

Whether tree search is active

§selected_component: Option<String>

Selected component ID (for detail panel)

§component_tab: ComponentDetailTab

Component detail sub-tab

§vuln_state: VulnExplorerState

Vulnerability explorer state

§license_state: LicenseViewState

License view state

§dependency_state: DependencyViewState

Dependency view state

§search_state: SearchState

Global search state

§focus_panel: FocusPanel

Focus panel (left list vs right detail)

§show_help: bool

Show help overlay

§show_export: bool

Show export dialog

§show_legend: bool

Show legend overlay

§status_message: Option<String>

Status message to display temporarily

§navigation_ctx: ViewNavigationContext

Navigation context for breadcrumbs

§should_quit: bool

Should quit

§tick: u64

Animation tick counter

§stats: SbomStats

Cached statistics

§quality_report: QualityReport

Quality report for the SBOM

§quality_state: QualityViewState

Quality view state

§compliance_results: Option<Vec<ComplianceResult>>

Compliance validation results for all standards (lazily computed)

§compliance_state: StandardComplianceState

Compliance view state

§sbom_index: NormalizedSbomIndex

Precomputed index for fast lookups

§source_state: SourcePanelState

Source tab state

Implementations§

Source§

impl ViewApp

Source

pub fn new(sbom: NormalizedSbom, raw_content: String) -> Self

Create a new ViewApp for the given SBOM.

Source

pub fn ensure_compliance_results(&mut self)

Lazily compute compliance results for all standards when first needed.

Source

pub fn next_tab(&mut self)

Switch to the next tab.

Source

pub fn prev_tab(&mut self)

Switch to the previous tab.

Source

pub fn select_tab(&mut self, tab: ViewTab)

Select a specific tab.

Source

pub fn get_sort_key(&self, id: &CanonicalId) -> Option<&ComponentSortKey>

Get the sort key for a component using the cached index.

Returns pre-computed lowercase strings to avoid repeated allocations during sorting.

Source

pub fn get_dependencies(&self, id: &CanonicalId) -> Vec<&DependencyEdge>

Get dependencies of a component using the cached index (O(k) instead of O(edges)).

Source

pub fn get_dependents(&self, id: &CanonicalId) -> Vec<&DependencyEdge>

Get dependents of a component using the cached index (O(k) instead of O(edges)).

Source

pub fn search_components_by_name(&self, query: &str) -> Vec<&Component>

Search components by name using the cached index.

Source

pub fn toggle_focus(&mut self)

Toggle focus between left and right panels.

Start search mode.

Stop search mode.

Execute search with current query.

Source

pub fn get_selected_component(&self) -> Option<&Component>

Get the currently selected component.

Source

pub fn jump_to_component_in_tree(&mut self, component_id: &str) -> bool

Jump tree selection to a component, expanding its group if needed.

Source

pub fn toggle_tree_grouping(&mut self)

Toggle tree grouping mode.

Source

pub fn toggle_tree_filter(&mut self)

Toggle tree filter.

Start tree search mode.

Stop tree search mode.

Clear tree search and exit search mode.

Source

pub fn tree_search_push_char(&mut self, c: char)

Add character to tree search query.

Source

pub fn tree_search_pop_char(&mut self)

Remove character from tree search query.

Source

pub fn next_component_tab(&mut self)

Cycle to next component detail tab.

Source

pub fn prev_component_tab(&mut self)

Cycle to previous component detail tab.

Source

pub fn select_component_tab(&mut self, tab: ComponentDetailTab)

Select a specific component detail tab.

Source

pub fn toggle_help(&mut self)

Toggle help overlay.

Source

pub fn toggle_export(&mut self)

Toggle export dialog.

Source

pub fn toggle_legend(&mut self)

Toggle legend overlay.

Source

pub fn close_overlays(&mut self)

Close all overlays.

Source

pub fn has_overlay(&self) -> bool

Check if any overlay is open.

Source

pub fn set_status_message(&mut self, msg: impl Into<String>)

Set a temporary status message.

Source

pub fn clear_status_message(&mut self)

Clear the status message.

Source

pub fn export(&mut self, format: ExportFormat)

Export the current SBOM to a file.

Source

pub fn export_compliance(&mut self, format: ExportFormat)

Export compliance results from the compliance tab

Source

pub fn go_back(&mut self) -> bool

Navigate back using breadcrumb history.

Source

pub fn navigate_up(&mut self)

Handle navigation in current view.

Source

pub fn navigate_down(&mut self)

Handle navigation in current view.

Source

pub fn page_up(&mut self)

Page up - move up by page size (10 items).

Source

pub fn page_down(&mut self)

Page down - move down by page size (10 items).

Source

pub fn go_first(&mut self)

Go to first item in current view.

Source

pub fn go_last(&mut self)

Go to last item in current view.

Source

pub fn handle_enter(&mut self)

Handle enter/select action.

Source

pub fn handle_source_map_enter(&mut self)

Jump the source panel to the section selected in the map.

Source

pub fn get_map_context_component_id(&self) -> Option<String>

Get the component ID currently shown in the source map context footer. Returns the canonical ID value string if inside the “components” section.

Source

pub fn get_selected_dependency_node_id(&self) -> Option<String>

Get the currently selected dependency node ID (if any).

Source

pub fn build_tree_nodes(&self) -> Vec<TreeNode>

Build tree nodes based on current grouping.

Auto Trait Implementations§

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

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more