pub struct IdentifierMetrics {
pub valid_purls: usize,
pub invalid_purls: usize,
pub valid_cpes: usize,
pub invalid_cpes: usize,
pub with_swid: usize,
pub ecosystems: Vec<String>,
pub missing_all_identifiers: usize,
}Expand description
Identifier quality metrics
Fields§
§valid_purls: usizeComponents with valid PURLs
invalid_purls: usizeComponents with invalid/malformed PURLs
valid_cpes: usizeComponents with valid CPEs
invalid_cpes: usizeComponents with invalid/malformed CPEs
with_swid: usizeComponents with SWID tags
ecosystems: Vec<String>Unique ecosystems identified
missing_all_identifiers: usizeComponents missing all identifiers (only name)
Implementations§
Source§impl IdentifierMetrics
impl IdentifierMetrics
Sourcepub fn from_sbom(sbom: &NormalizedSbom) -> Self
pub fn from_sbom(sbom: &NormalizedSbom) -> Self
Calculate identifier metrics from an SBOM
Sourcepub fn quality_score(&self, total_components: usize) -> f32
pub fn quality_score(&self, total_components: usize) -> f32
Calculate identifier quality score (0-100)
Trait Implementations§
Source§impl Clone for IdentifierMetrics
impl Clone for IdentifierMetrics
Source§fn clone(&self) -> IdentifierMetrics
fn clone(&self) -> IdentifierMetrics
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 IdentifierMetrics
impl Debug for IdentifierMetrics
Source§impl<'de> Deserialize<'de> for IdentifierMetrics
impl<'de> Deserialize<'de> for IdentifierMetrics
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 IdentifierMetrics
impl RefUnwindSafe for IdentifierMetrics
impl Send for IdentifierMetrics
impl Sync for IdentifierMetrics
impl Unpin for IdentifierMetrics
impl UnsafeUnpin for IdentifierMetrics
impl UnwindSafe for IdentifierMetrics
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