pub struct CycloneDxSbom {
pub bom_format: String,
pub spec_version: String,
pub serial_number: String,
pub version: u32,
pub metadata: SbomMetadata,
pub components: Vec<Component>,
pub dependencies: Vec<Dependency>,
}Expand description
A complete CycloneDX 1.5 SBOM document.
Field names use #[serde(rename_all = "camelCase")] to match the
CycloneDX JSON schema (bomFormat, specVersion, serialNumber, …).
Fields§
§bom_format: StringAlways the literal string "CycloneDX".
spec_version: StringCycloneDX spec version — "1.5".
serial_number: Stringurn:uuid:... serial number, derived from the output ELF digest.
version: u32Document revision; 1 for a freshly emitted SBOM.
metadata: SbomMetadataBuild metadata: timestamp + the synth compiler tool entry.
components: Vec<Component>Components: the input WASM, the output ELF, and one per WASM import.
dependencies: Vec<Dependency>Dependency graph linking the output ELF to its inputs.
Implementations§
Source§impl CycloneDxSbom
impl CycloneDxSbom
Sourcepub fn new(inputs: &SbomInputs<'_>, timestamp: String) -> Self
pub fn new(inputs: &SbomInputs<'_>, timestamp: String) -> Self
Build a CycloneDX 1.5 SBOM describing one synth compilation.
timestamp is the RFC-3339 UTC string for metadata.timestamp; the
caller supplies it so tests can pin a fixed value and production code
can pass now_rfc3339.
Sourcepub fn sidecar_path(elf_path: &Path) -> PathBuf
pub fn sidecar_path(elf_path: &Path) -> PathBuf
Compute the SBOM path next to an output ELF: replaces the file
extension with .cdx.json (the conventional CycloneDX-JSON suffix).
Examples:
foo.elf->foo.cdx.jsonout->out.cdx.json
Trait Implementations§
Source§impl Clone for CycloneDxSbom
impl Clone for CycloneDxSbom
Source§fn clone(&self) -> CycloneDxSbom
fn clone(&self) -> CycloneDxSbom
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more