pub struct Sbom {
pub bom_format: String,
pub spec_version: String,
pub serial_number: String,
pub version: u32,
pub metadata: Option<SbomMetadata>,
pub components: Vec<SbomComponent>,
pub dependencies: Vec<SbomDependency>,
}Expand description
CycloneDX SBOM (Software Bill of Materials)
Follows the CycloneDX 1.5 specification for SBOM. See: https://cyclonedx.org/specification/overview/
Fields§
§bom_format: StringBOM format (always “CycloneDX”)
spec_version: StringSpec version (e.g., “1.5”)
serial_number: StringSerial number (UUID)
version: u32Version of this SBOM
metadata: Option<SbomMetadata>Metadata about the SBOM
components: Vec<SbomComponent>Components in the SBOM
dependencies: Vec<SbomDependency>Dependencies between components
Implementations§
Source§impl Sbom
impl Sbom
Sourcepub fn new(
component_name: impl Into<String>,
component_version: impl Into<String>,
) -> Self
pub fn new( component_name: impl Into<String>, component_version: impl Into<String>, ) -> Self
Create a new SBOM for a composed WASM component
Sourcepub fn add_component(
&mut self,
name: impl Into<String>,
version: impl Into<String>,
hash: impl Into<String>,
)
pub fn add_component( &mut self, name: impl Into<String>, version: impl Into<String>, hash: impl Into<String>, )
Add a component to the SBOM
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sbom
impl<'de> Deserialize<'de> for Sbom
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 Sbom
impl RefUnwindSafe for Sbom
impl Send for Sbom
impl Sync for Sbom
impl Unpin for Sbom
impl UnwindSafe for Sbom
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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