pub struct DiffEngine { /* private fields */ }Expand description
Semantic diff engine for comparing SBOMs.
Implementations§
Source§impl DiffEngine
impl DiffEngine
Sourcepub const fn with_cost_model(self, cost_model: CostModel) -> Self
pub const fn with_cost_model(self, cost_model: CostModel) -> Self
Create a diff engine with a custom cost model
Sourcepub const fn with_fuzzy_config(self, config: FuzzyMatchConfig) -> Self
pub const fn with_fuzzy_config(self, config: FuzzyMatchConfig) -> Self
Set fuzzy matching configuration
Sourcepub const fn include_unchanged(self, include: bool) -> Self
pub const fn include_unchanged(self, include: bool) -> Self
Include unchanged components in the result
Sourcepub fn with_graph_diff(self, config: GraphDiffConfig) -> Self
pub fn with_graph_diff(self, config: GraphDiffConfig) -> Self
Enable graph-aware diffing with the given configuration
Sourcepub fn with_matching_rules(
self,
config: MatchingRulesConfig,
) -> Result<Self, String>
pub fn with_matching_rules( self, config: MatchingRulesConfig, ) -> Result<Self, String>
Set custom matching rules from a configuration
Sourcepub fn with_rule_engine(self, engine: RuleEngine) -> Self
pub fn with_rule_engine(self, engine: RuleEngine) -> Self
Set custom matching rules engine directly
Sourcepub fn with_matcher(self, matcher: Box<dyn ComponentMatcher>) -> Self
pub fn with_matcher(self, matcher: Box<dyn ComponentMatcher>) -> Self
Set a custom component matcher.
Sourcepub const fn with_large_sbom_config(self, config: LargeSbomConfig) -> Self
pub const fn with_large_sbom_config(self, config: LargeSbomConfig) -> Self
Configure large SBOM optimization settings.
Sourcepub const fn large_sbom_config(&self) -> &LargeSbomConfig
pub const fn large_sbom_config(&self) -> &LargeSbomConfig
Get the large SBOM configuration.
Sourcepub fn has_custom_matcher(&self) -> bool
pub fn has_custom_matcher(&self) -> bool
Check if a custom matcher is configured
Sourcepub const fn graph_diff_enabled(&self) -> bool
pub const fn graph_diff_enabled(&self) -> bool
Check if graph diffing is enabled
Sourcepub const fn has_matching_rules(&self) -> bool
pub const fn has_matching_rules(&self) -> bool
Check if custom matching rules are configured
Sourcepub fn diff(
&self,
old: &NormalizedSbom,
new: &NormalizedSbom,
) -> Result<DiffResult, SbomDiffError>
pub fn diff( &self, old: &NormalizedSbom, new: &NormalizedSbom, ) -> Result<DiffResult, SbomDiffError>
Compare two SBOMs and return the diff result
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DiffEngine
impl !RefUnwindSafe for DiffEngine
impl Send for DiffEngine
impl Sync for DiffEngine
impl Unpin for DiffEngine
impl UnsafeUnpin for DiffEngine
impl !UnwindSafe for DiffEngine
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
Mutably borrows from an owned value. Read more
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>
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 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>
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