pub struct Component {Show 21 fields
pub canonical_id: CanonicalId,
pub identifiers: ComponentIdentifiers,
pub name: String,
pub version: Option<String>,
pub semver: Option<Version>,
pub component_type: ComponentType,
pub ecosystem: Option<Ecosystem>,
pub licenses: LicenseInfo,
pub supplier: Option<Organization>,
pub hashes: Vec<Hash>,
pub external_refs: Vec<ExternalReference>,
pub vulnerabilities: Vec<VulnerabilityRef>,
pub vex_status: Option<VexStatus>,
pub content_hash: u64,
pub extensions: ComponentExtensions,
pub description: Option<String>,
pub copyright: Option<String>,
pub author: Option<String>,
pub group: Option<String>,
pub staleness: Option<StalenessInfo>,
pub eol: Option<EolInfo>,
}Expand description
Component in the normalized SBOM
Fields§
§canonical_id: CanonicalIdCanonical identifier
identifiers: ComponentIdentifiersVarious identifiers (PURL, CPE, etc.)
name: StringComponent name
version: Option<String>Version string
semver: Option<Version>Parsed semantic version (if valid)
component_type: ComponentTypeComponent type
ecosystem: Option<Ecosystem>Package ecosystem
licenses: LicenseInfoLicense information
supplier: Option<Organization>Supplier/vendor information
hashes: Vec<Hash>Cryptographic hashes
external_refs: Vec<ExternalReference>External references
vulnerabilities: Vec<VulnerabilityRef>Known vulnerabilities
vex_status: Option<VexStatus>VEX status
content_hash: u64Content hash for quick comparison
extensions: ComponentExtensionsFormat-specific extensions
description: Option<String>Description
copyright: Option<String>Copyright text
Author information
group: Option<String>Group/namespace (e.g., Maven groupId)
staleness: Option<StalenessInfo>Staleness information (populated by enrichment)
eol: Option<EolInfo>End-of-life information (populated by enrichment)
Implementations§
Source§impl Component
impl Component
Sourcepub fn new(name: String, format_id: String) -> Self
pub fn new(name: String, format_id: String) -> Self
Create a new component with minimal required fields
Sourcepub fn with_version(self, version: String) -> Self
pub fn with_version(self, version: String) -> Self
Set the version and try to parse as semver
Sourcepub fn calculate_content_hash(&mut self)
pub fn calculate_content_hash(&mut self)
Calculate and update content hash
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
Get display name with version
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Component
impl<'de> Deserialize<'de> for Component
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
Source§impl From<&Component> for ComponentRef
impl From<&Component> for ComponentRef
Auto Trait Implementations§
impl Freeze for Component
impl RefUnwindSafe for Component
impl Send for Component
impl Sync for Component
impl Unpin for Component
impl UnsafeUnpin for Component
impl UnwindSafe for Component
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