pub struct MetadataChange {
pub field: String,
pub old_value: Option<String>,
pub new_value: Option<String>,
pub kind: MetadataChangeKind,
}Expand description
A document-level metadata change between two SBOMs.
Surfaces changes that are invisible in the component/dependency/vulnerability passes: author or tool churn, timestamp updates, spec-version upgrades (e.g. CycloneDX 1.5 -> 1.7), lifecycle-phase transitions, signature presence or algorithm changes, and document- or primary-component version bumps. This is the cross-cutting metadata signal the BSI gap analysis flagged as missing.
Fields§
§field: StringStable field key (e.g. name, spec_version, created, creator.tool,
lifecycle_phase, signature.algorithm, primary_component_version).
old_value: Option<String>Value in the old SBOM (None when the field was absent / added).
new_value: Option<String>Value in the new SBOM (None when the field was removed).
kind: MetadataChangeKindWhether the field was added, removed, or modified.
Implementations§
Source§impl MetadataChange
impl MetadataChange
Sourcepub fn from_values(
field: impl Into<String>,
old_value: Option<String>,
new_value: Option<String>,
) -> Option<Self>
pub fn from_values( field: impl Into<String>, old_value: Option<String>, new_value: Option<String>, ) -> Option<Self>
Build a metadata change from a field key and the two optional values,
inferring the MetadataChangeKind from presence. Returns None when
the values are equal (no change to report).
Trait Implementations§
Source§impl Clone for MetadataChange
impl Clone for MetadataChange
Source§fn clone(&self) -> MetadataChange
fn clone(&self) -> MetadataChange
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 MetadataChange
impl Debug for MetadataChange
Source§impl<'de> Deserialize<'de> for MetadataChange
impl<'de> Deserialize<'de> for MetadataChange
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>,
impl Eq for MetadataChange
Source§impl PartialEq for MetadataChange
impl PartialEq for MetadataChange
Source§fn eq(&self, other: &MetadataChange) -> bool
fn eq(&self, other: &MetadataChange) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for MetadataChange
impl Serialize for MetadataChange
impl StructuralPartialEq for MetadataChange
Auto Trait Implementations§
impl Freeze for MetadataChange
impl RefUnwindSafe for MetadataChange
impl Send for MetadataChange
impl Sync for MetadataChange
impl Unpin for MetadataChange
impl UnsafeUnpin for MetadataChange
impl UnwindSafe for MetadataChange
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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