pub struct CompletenessMetrics {
pub components_with_version: f32,
pub components_with_purl: f32,
pub components_with_cpe: f32,
pub components_with_supplier: f32,
pub components_with_hashes: f32,
pub components_with_licenses: f32,
pub components_with_description: f32,
pub has_creator_info: bool,
pub has_timestamp: bool,
pub has_serial_number: bool,
pub total_components: usize,
}Expand description
Overall completeness metrics for an SBOM
Fields§
§components_with_version: f32Percentage of components with versions (0-100)
components_with_purl: f32Percentage of components with PURLs (0-100)
components_with_cpe: f32Percentage of components with CPEs (0-100)
components_with_supplier: f32Percentage of components with suppliers (0-100)
components_with_hashes: f32Percentage of components with hashes (0-100)
components_with_licenses: f32Percentage of components with licenses (0-100)
components_with_description: f32Percentage of components with descriptions (0-100)
has_creator_info: boolWhether document has creator information
has_timestamp: boolWhether document has timestamp
has_serial_number: boolWhether document has serial number/ID
total_components: usizeTotal component count
Implementations§
Source§impl CompletenessMetrics
impl CompletenessMetrics
Sourcepub fn from_sbom(sbom: &NormalizedSbom) -> Self
pub fn from_sbom(sbom: &NormalizedSbom) -> Self
Calculate completeness metrics from an SBOM
Sourcepub fn overall_score(&self, weights: &CompletenessWeights) -> f32
pub fn overall_score(&self, weights: &CompletenessWeights) -> f32
Calculate overall completeness score (0-100)
Trait Implementations§
Source§impl Clone for CompletenessMetrics
impl Clone for CompletenessMetrics
Source§fn clone(&self) -> CompletenessMetrics
fn clone(&self) -> CompletenessMetrics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompletenessMetrics
impl Debug for CompletenessMetrics
Source§impl<'de> Deserialize<'de> for CompletenessMetrics
impl<'de> Deserialize<'de> for CompletenessMetrics
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 CompletenessMetrics
impl RefUnwindSafe for CompletenessMetrics
impl Send for CompletenessMetrics
impl Sync for CompletenessMetrics
impl Unpin for CompletenessMetrics
impl UnsafeUnpin for CompletenessMetrics
impl UnwindSafe for CompletenessMetrics
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