pub struct ComponentIdentifiers {
pub purl: Option<String>,
pub cpe: Vec<String>,
pub swid: Option<String>,
pub format_id: String,
pub aliases: Vec<String>,
}Expand description
Component identifiers from various sources
Fields§
§purl: Option<String>Package URL (preferred identifier)
cpe: Vec<String>Common Platform Enumeration identifiers
swid: Option<String>Software Identification tag
format_id: StringOriginal format-specific identifier
aliases: Vec<String>Known aliases for this component
Implementations§
Source§impl ComponentIdentifiers
impl ComponentIdentifiers
Sourcepub fn canonical_id(&self) -> CanonicalId
pub fn canonical_id(&self) -> CanonicalId
Get the best available canonical ID (without component context)
For better stability, prefer canonical_id_with_context() which can
generate synthetic IDs from component metadata.
Sourcepub fn canonical_id_with_context(
&self,
name: &str,
version: Option<&str>,
group: Option<&str>,
) -> CanonicalIdResult
pub fn canonical_id_with_context( &self, name: &str, version: Option<&str>, group: Option<&str>, ) -> CanonicalIdResult
Get the best available canonical ID with component context for stable fallback
This method uses a tiered fallback strategy:
- PURL (most reliable)
- CPE
- SWID
- Synthetic (group:name@version) - stable across regenerations
- Format-specific ID (least stable)
Returns both the ID and any warnings about stability.
Sourcepub fn has_stable_id(&self) -> bool
pub fn has_stable_id(&self) -> bool
Check if this component has any stable identifiers
Sourcepub fn id_reliability(&self) -> IdReliability
pub fn id_reliability(&self) -> IdReliability
Get the reliability level of available identifiers
Trait Implementations§
Source§impl Clone for ComponentIdentifiers
impl Clone for ComponentIdentifiers
Source§fn clone(&self) -> ComponentIdentifiers
fn clone(&self) -> ComponentIdentifiers
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 ComponentIdentifiers
impl Debug for ComponentIdentifiers
Source§impl Default for ComponentIdentifiers
impl Default for ComponentIdentifiers
Source§fn default() -> ComponentIdentifiers
fn default() -> ComponentIdentifiers
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ComponentIdentifiers
impl<'de> Deserialize<'de> for ComponentIdentifiers
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 ComponentIdentifiers
impl RefUnwindSafe for ComponentIdentifiers
impl Send for ComponentIdentifiers
impl Sync for ComponentIdentifiers
impl Unpin for ComponentIdentifiers
impl UnsafeUnpin for ComponentIdentifiers
impl UnwindSafe for ComponentIdentifiers
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