pub struct DiffResult {Show 13 fields
pub summary: DiffSummary,
pub components: ChangeSet<ComponentChange>,
pub dependencies: ChangeSet<DependencyChange>,
pub licenses: LicenseChanges,
pub vulnerabilities: VulnerabilityChanges,
pub semantic_score: f64,
pub metadata_changes: Vec<MetadataChange>,
pub graph_changes: Vec<DependencyGraphChange>,
pub graph_summary: Option<GraphChangeSummary>,
pub rules_applied: usize,
pub quality_delta: Option<QualityDelta>,
pub match_metrics: Option<MatchMetrics>,
pub ml_regressions: Vec<MlRegression>,
}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: f64Overall semantic similarity of the two documents, 0.0-100.0
(100 = identical). This is the single-diff scale used by every
diff output; the multi-SBOM commands rescale it to a 0.0-1.0
fraction (MatrixResult::similarity_scores, and 1 - similarity
for MultiDiffSummary::deviation_scores).
metadata_changes: Vec<MetadataChange>Document-level metadata changes (author, tool, timestamp, spec version, lifecycle phase, signature, document/primary-component version)
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
quality_delta: Option<QualityDelta>Quality impact of this diff (computed post-diff)
match_metrics: Option<MatchMetrics>Matching quality metrics (populated during diff)
ml_regressions: Vec<MlRegression>Supported numeric ML performance metrics that moved in the adverse direction.
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.
Unchanged inventory entries (produced under --include-unchanged) are
not changes: a zero-change diff reports false regardless of the flag.
Sourcepub fn refresh_derived_day_counts(&mut self) -> bool
pub fn refresh_derived_day_counts(&mut self) -> bool
Recompute date-derived vulnerability day counts for today.
Cached results embed the day they were computed; the incremental engine calls this on cache hits so counts (and the SLA statuses derived from them) do not go stale across midnight. Returns true if anything changed.
Sourcepub fn day_counts_stale(&self) -> bool
pub fn day_counts_stale(&self) -> bool
Whether any vulnerability day-count field is stale for today.
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 (const: unstable) · 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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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