pub struct DiffResult {
pub summary: DiffSummary,
pub components: ChangeSet<ComponentChange>,
pub dependencies: ChangeSet<DependencyChange>,
pub licenses: LicenseChanges,
pub vulnerabilities: VulnerabilityChanges,
pub semantic_score: f64,
pub graph_changes: Vec<DependencyGraphChange>,
pub graph_summary: Option<GraphChangeSummary>,
pub rules_applied: usize,
}Expand description
Complete result of an SBOM diff operation.
Fields§
§summary: DiffSummarySummary statistics
components: ChangeSet<ComponentChange>Component changes
dependencies: ChangeSet<DependencyChange>Dependency changes
licenses: LicenseChangesLicense changes
vulnerabilities: VulnerabilityChangesVulnerability changes
semantic_score: f64Total semantic score
graph_changes: Vec<DependencyGraphChange>Graph structural changes (only populated if graph diffing is enabled)
graph_summary: Option<GraphChangeSummary>Summary of graph changes
rules_applied: usizeNumber of custom matching rules applied
Implementations§
Source§impl DiffResult
impl DiffResult
Sourcepub fn calculate_summary(&mut self)
pub fn calculate_summary(&mut self)
Calculate and update summary statistics
Sourcepub fn has_changes(&self) -> bool
pub fn has_changes(&self) -> bool
Check if there are any changes.
Checks both the pre-computed summary and the source-of-truth fields to be
safe regardless of whether calculate_summary() was called.
Sourcepub fn find_component_by_id(&self, id: &CanonicalId) -> Option<&ComponentChange>
pub fn find_component_by_id(&self, id: &CanonicalId) -> Option<&ComponentChange>
Find a component change by canonical ID
Sourcepub fn find_component_by_id_str(&self, id_str: &str) -> Option<&ComponentChange>
pub fn find_component_by_id_str(&self, id_str: &str) -> Option<&ComponentChange>
Find a component change by ID string
Sourcepub fn all_component_changes(&self) -> Vec<&ComponentChange>
pub fn all_component_changes(&self) -> Vec<&ComponentChange>
Get all component changes as a flat list with their indices for navigation
Sourcepub fn find_vulns_for_component(
&self,
component_id: &CanonicalId,
) -> Vec<&VulnerabilityDetail>
pub fn find_vulns_for_component( &self, component_id: &CanonicalId, ) -> Vec<&VulnerabilityDetail>
Find vulnerabilities affecting a specific component by ID
Sourcepub fn build_component_id_index(&self) -> HashMap<String, &ComponentChange>
pub fn build_component_id_index(&self) -> HashMap<String, &ComponentChange>
Build an index of component IDs to their changes for fast lookup
Sourcepub fn filter_by_severity(&mut self, min_severity: &str)
pub fn filter_by_severity(&mut self, min_severity: &str)
Filter vulnerabilities by minimum severity level
Sourcepub fn filter_by_vex(&mut self)
pub fn filter_by_vex(&mut self)
Filter out vulnerabilities where VEX status is NotAffected or Fixed.
Keeps vulnerabilities that are Affected, UnderInvestigation, or have no VEX status.
Trait Implementations§
Source§impl Clone for DiffResult
impl Clone for DiffResult
Source§fn clone(&self) -> DiffResult
fn clone(&self) -> DiffResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiffResult
impl Debug for DiffResult
Source§impl Default for DiffResult
impl Default for DiffResult
Source§impl<'de> Deserialize<'de> for DiffResult
impl<'de> Deserialize<'de> for DiffResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DiffResult
impl RefUnwindSafe for DiffResult
impl Send for DiffResult
impl Sync for DiffResult
impl Unpin for DiffResult
impl UnsafeUnpin for DiffResult
impl UnwindSafe for DiffResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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