pub struct CostModel {
pub component_added: u32,
pub component_removed: u32,
pub version_patch: u32,
pub version_minor: u32,
pub version_major: u32,
pub license_changed: u32,
pub supplier_changed: u32,
pub vulnerability_introduced: u32,
pub vulnerability_resolved: i32,
pub dependency_added: u32,
pub dependency_removed: u32,
pub hash_mismatch: u32,
}Expand description
Cost model configuration for semantic diff operations.
Costs are used to determine the minimum-cost alignment between two SBOMs. Higher costs indicate more significant changes.
Fields§
§component_added: u32Cost for adding a new component
component_removed: u32Cost for removing a component
version_patch: u32Cost for patch version change
version_minor: u32Cost for minor version change
version_major: u32Cost for major version change
license_changed: u32Cost for license change
supplier_changed: u32Cost for supplier change
vulnerability_introduced: u32Cost for introducing a vulnerability
vulnerability_resolved: i32Reward (negative cost) for resolving a vulnerability
dependency_added: u32Cost for adding a dependency
dependency_removed: u32Cost for removing a dependency
hash_mismatch: u32Cost for hash mismatch (integrity concern)
Implementations§
Source§impl CostModel
impl CostModel
Sourcepub fn security_focused() -> Self
pub fn security_focused() -> Self
Create a security-focused cost model
Sourcepub fn compliance_focused() -> Self
pub fn compliance_focused() -> Self
Create a compliance-focused cost model
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CostModel
impl<'de> Deserialize<'de> for CostModel
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CostModel
impl RefUnwindSafe for CostModel
impl Send for CostModel
impl Sync for CostModel
impl Unpin for CostModel
impl UnsafeUnpin for CostModel
impl UnwindSafe for CostModel
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> 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>
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