pub struct CycloneDxBuilder { /* private fields */ }
Expand description

Builder for CycloneDx.

Implementations§

source§

impl CycloneDxBuilder

source

pub fn schema<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

source

pub fn bom_format<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Specifies the format of the BOM. This helps to identify the file as CycloneDX since BOMs do not have a filename convention nor does JSON schema support namespaces. This value MUST be “CycloneDX”.

source

pub fn components<VALUE: Into<Vec<Component>>>( &mut self, value: VALUE ) -> &mut Self

A list of software and hardware components.

source

pub fn compositions<VALUE: Into<Vec<Compositions>>>( &mut self, value: VALUE ) -> &mut Self

Compositions describe constituent parts (including components, services, and dependency relationships) and their completeness.

source

pub fn dependencies<VALUE: Into<Vec<Dependency>>>( &mut self, value: VALUE ) -> &mut Self

Provides the ability to document dependency relationships.

source

pub fn external_references<VALUE: Into<Vec<ExternalReference>>>( &mut self, value: VALUE ) -> &mut Self

External references provide a way to document systems, sites, and information that may be relevant but which are not included with the BOM.

source

pub fn metadata<VALUE: Into<Metadata>>(&mut self, value: VALUE) -> &mut Self

Provides additional information about a BOM.

source

pub fn serial_number<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Every BOM generated SHOULD have a unique serial number, even if the contents of the BOM have not changed over time. If specified, the serial number MUST conform to RFC-4122. Use of serial numbers are RECOMMENDED.

source

pub fn services<VALUE: Into<Vec<Service>>>(&mut self, value: VALUE) -> &mut Self

A list of services. This may include microservices, function-as-a-service, and other types of network or intra-process services.

source

pub fn signature<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Enveloped signature in JSON Signature Format (JSF).

source

pub fn spec_version<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

The version of the CycloneDX specification a BOM conforms to (starting at version 1.2).

source

pub fn version<VALUE: Into<i64>>(&mut self, value: VALUE) -> &mut Self

Whenever an existing BOM is modified, either manually or through automated processes, the version of the BOM SHOULD be incremented by 1. When a system is presented with multiple BOMs with identical serial numbers, the system SHOULD use the most recent version of the BOM. The default version is ‘1’.

source

pub fn vulnerabilities<VALUE: Into<Vec<Vulnerability>>>( &mut self, value: VALUE ) -> &mut Self

Vulnerabilities identified in components or services.

source

pub fn build(&self) -> Result<CycloneDx, CycloneDxBuilderError>

Builds a new CycloneDx.

Errors

If a required field has not been initialized.

Trait Implementations§

source§

impl Clone for CycloneDxBuilder

source§

fn clone(&self) -> CycloneDxBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for CycloneDxBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.