pub struct ComplianceChecker { /* private fields */ }Expand description
Compliance checker for SBOMs
Implementations§
Source§impl ComplianceChecker
impl ComplianceChecker
Sourcepub const fn new(level: ComplianceLevel) -> Self
pub const fn new(level: ComplianceLevel) -> Self
Create a new compliance checker
Sourcepub fn with_sidecar(self, sidecar: CraSidecarMetadata) -> Self
pub fn with_sidecar(self, sidecar: CraSidecarMetadata) -> Self
Attach CRA sidecar metadata to supplement SBOM-level fields.
Sidecar values are only consulted as fallbacks — fields present in the
SBOM always take precedence. Used by validate, quality, and view
CLIs via the --cra-sidecar flag (with auto-discovery for adjacent
<sbom>.cra.{json,yaml} files).
Sourcepub const fn with_product_class(self, class: CraProductClass) -> Self
pub const fn with_product_class(self, class: CraProductClass) -> Self
Set the CRA Annex III/IV product class explicitly.
Sidecar productClass (when set on the attached sidecar) wins over
this; resolve via Self::effective_product_class.
Sourcepub fn effective_product_class(&self) -> CraProductClass
pub fn effective_product_class(&self) -> CraProductClass
Resolve the effective product class:
- sidecar
productClassif present, - otherwise
with_product_classvalue, - otherwise
CraProductClass::Default.
Sourcepub fn effective_route(&self) -> ConformityRoute
pub fn effective_route(&self) -> ConformityRoute
Resolve the effective conformity-assessment route. Falls back to
CraProductClass::default_route() when the sidecar doesn’t pin one.
Sourcepub fn class_severity(&self, check: ClassCheck) -> Option<ViolationSeverity>
pub fn class_severity(&self, check: ClassCheck) -> Option<ViolationSeverity>
CRA-P3.2 calibration table — severity for a given check at the
effective product class. Returns None when the check does not
apply for that class (e.g., EUCC reference at Default).
Sourcepub fn vendor_hash_threshold(&self) -> f64
pub fn vendor_hash_threshold(&self) -> f64
Vendor-hash coverage threshold (single-stage) below which a violation
fires. The severity is class_severity(VendorHashCoverage). Values:
Default 50%, Important-1 80%, Important-2 80%, Critical 100%.
Sourcepub fn has_explicit_product_class(&self) -> bool
pub fn has_explicit_product_class(&self) -> bool
Whether a CRA product class has been explicitly configured (either
via with_product_class() or the attached sidecar). Used by the
per-check calibration to decide whether to override phase-based
defaults — when no class is set, existing phase-driven behavior is
preserved verbatim for backwards compatibility.
Sourcepub fn check(&self, sbom: &NormalizedSbom) -> ComplianceResult
pub fn check(&self, sbom: &NormalizedSbom) -> ComplianceResult
Check an SBOM for compliance.
Selects the [StandardChecker] for the configured level (the seven
dedicated profiles get their own checker; the rest take the generic
path), runs it, then back-fills harmonised-standard references from the
rule registry and attaches the CRA Annex VIII conformity summary when a
product class has been pinned on a CRA profile.
Trait Implementations§
Source§impl Clone for ComplianceChecker
impl Clone for ComplianceChecker
Source§fn clone(&self) -> ComplianceChecker
fn clone(&self) -> ComplianceChecker
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 ComplianceChecker
impl Debug for ComplianceChecker
Auto Trait Implementations§
impl Freeze for ComplianceChecker
impl RefUnwindSafe for ComplianceChecker
impl Send for ComplianceChecker
impl Sync for ComplianceChecker
impl Unpin for ComplianceChecker
impl UnsafeUnpin for ComplianceChecker
impl UnwindSafe for ComplianceChecker
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,
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