Skip to main content

ViewApp

Struct ViewApp 

Source
pub struct ViewApp { /* private fields */ }
Expand description

Main application state for single SBOM viewing.

Implementations§

Source§

impl ViewApp

Source

pub fn new(sbom: NormalizedSbom, raw_content: &str) -> 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 const fn next_tab(&mut self)

Switch to the next tab.

Source

pub const fn prev_tab(&mut self)

Switch to the previous tab.

Source

pub const 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 const 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 get_selected_group_info(&self) -> Option<(String, Vec<String>)>

Get the currently selected tree node info (Group label + children component IDs, or None if a component is selected or nothing is selected).

Source

pub fn toggle_bookmark(&mut self)

Toggle bookmark on the currently selected component.

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 const fn next_component_tab(&mut self)

Cycle to next component detail tab.

Source

pub const fn prev_component_tab(&mut self)

Cycle to previous component detail tab.

Source

pub const fn toggle_help(&mut self)

Toggle help overlay.

Source

pub const fn toggle_export(&mut self)

Toggle export dialog.

Source

pub const fn toggle_legend(&mut self)

Toggle legend overlay.

Source

pub const fn close_overlays(&mut self)

Close all overlays.

Source

pub const 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.

If status_sticky is set the message is kept for one extra keypress, then cleared on the subsequent call.

Source

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

Export the current SBOM to a file.

The export is scoped to the active tab: e.g. if the user is on the Vulnerabilities tab only vulnerability data is included.

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.

Source

pub fn page_down(&mut self)

Page down - move down by page size.

Source

pub const 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