pub struct ProvenanceMetrics {Show 15 fields
pub has_tool_creator: bool,
pub has_tool_version: bool,
pub has_org_creator: bool,
pub has_contact_email: bool,
pub has_serial_number: bool,
pub has_document_name: bool,
pub timestamp_age_days: u32,
pub timestamp_known: bool,
pub is_fresh: bool,
pub has_primary_component: bool,
pub lifecycle_phase: Option<String>,
pub completeness_declaration: CompletenessDeclaration,
pub has_signature: bool,
pub has_citations: bool,
pub citations_count: usize,
}Expand description
Document provenance and authorship quality metrics
Fields§
§has_tool_creator: boolWhether the SBOM was created by an identified tool
has_tool_version: boolWhether the tool creator includes version information
has_org_creator: boolWhether an organization is identified as creator
has_contact_email: boolWhether any creator has a contact email
has_serial_number: boolWhether the document has a serial number / namespace
has_document_name: boolWhether the document has a name
timestamp_age_days: u32Age of the SBOM in days (since creation timestamp). Meaningful only
when timestamp_known is true; a missing timestamp is not “very old”.
timestamp_known: boolWhether the document carries a real creation timestamp (vs. the epoch sentinel parsers substitute for a missing/invalid one).
is_fresh: boolWhether the SBOM is considered fresh (< 90 days old). False when the timestamp is unknown — a missing timestamp is not fresh.
has_primary_component: boolWhether a primary/described component is identified
lifecycle_phase: Option<String>SBOM lifecycle phase (from CycloneDX 1.5+ metadata)
completeness_declaration: CompletenessDeclarationSelf-declared completeness level of the SBOM
has_signature: boolWhether the SBOM has a digital signature
has_citations: boolWhether the SBOM has data provenance citations (CycloneDX 1.7+)
citations_count: usizeNumber of data provenance citations
Implementations§
Source§impl ProvenanceMetrics
impl ProvenanceMetrics
Sourcepub fn from_sbom(sbom: &NormalizedSbom) -> Self
pub fn from_sbom(sbom: &NormalizedSbom) -> Self
Calculate provenance metrics from an SBOM
Sourcepub fn quality_score(&self, is_cyclonedx: bool) -> f32
pub fn quality_score(&self, is_cyclonedx: bool) -> f32
Calculate provenance quality score (0-100)
Weighted checklist: tool creator (15%), tool version (5%), org creator (12%), contact email (8%), serial number (8%), document name (5%), primary component (12%), completeness declaration (8%), signature (5%), lifecycle phase (10% CDX-only).
Freshness (is_fresh) is deliberately NOT scored: it is computed from
the live wall clock, so identical SBOM bytes would score differently
across days (and flip at midnight). It remains available as display
metadata; the score itself is a pure function of the document.
Trait Implementations§
Source§impl Clone for ProvenanceMetrics
impl Clone for ProvenanceMetrics
Source§fn clone(&self) -> ProvenanceMetrics
fn clone(&self) -> ProvenanceMetrics
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 ProvenanceMetrics
impl Debug for ProvenanceMetrics
Source§impl<'de> Deserialize<'de> for ProvenanceMetrics
impl<'de> Deserialize<'de> for ProvenanceMetrics
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 ProvenanceMetrics
impl RefUnwindSafe for ProvenanceMetrics
impl Send for ProvenanceMetrics
impl Sync for ProvenanceMetrics
impl Unpin for ProvenanceMetrics
impl UnsafeUnpin for ProvenanceMetrics
impl UnwindSafe for ProvenanceMetrics
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