Struct tugger_licensing::LicensedComponent[][src]

pub struct LicensedComponent { /* fields omitted */ }

Represents a software component with licensing information.

Implementations

impl LicensedComponent[src]

pub fn new_spdx(name: &str, spdx_expression: &str) -> Result<Self>[src]

Construct a new instance from an SPDX expression.

pub fn new_none(name: &str) -> Self[src]

Construct a new instance with no licensing defined.

pub fn new_public_domain(name: &str) -> Self[src]

Construct a new instance with a license in the public domain.

pub fn new_unknown(name: &str, terms: Vec<String>) -> Self[src]

Construct a new instance with an unknown license.

pub fn name(&self) -> &str[src]

Obtain the name of this software component.

pub fn flavor(&self) -> &ComponentFlavor[src]

The type of this component.

pub fn set_flavor(&mut self, flavor: ComponentFlavor)[src]

Set the flavor of this component.

pub fn license(&self) -> &LicenseFlavor[src]

Obtain the flavor of license for this component.

pub fn spdx_expression(&self) -> Option<&Expression>[src]

Obtain the SPDX expression for this component’s license.

pub fn is_simple_spdx_expression(&self) -> bool[src]

Whether the SPDX expression is simple.

Simple is defined as having at most a single license.

pub fn source_location(&self) -> &SourceLocation[src]

Obtain the location where the source of this component can be obtained.

pub fn set_source_location(&mut self, location: SourceLocation)[src]

Define where source code for this component can be obtained from.

pub fn license_texts(&self) -> &Vec<String>[src]

Obtain the explicitly set license texts for this component.

pub fn add_license_text(&mut self, text: impl ToString)[src]

Define the license text for this component.

pub fn is_spdx(&self) -> bool[src]

Returns whether all license identifiers are SPDX.

pub fn all_spdx_licenses(&self) -> BTreeSet<(LicenseId, Option<ExceptionId>)>[src]

Obtain all SPDX licenses referenced by this component.

The first element of the returned tuple is the license identifier. The 2nd is an optional exclusion identifier.

Trait Implementations

impl Clone for LicensedComponent[src]

impl Debug for LicensedComponent[src]

impl PartialEq<LicensedComponent> for LicensedComponent[src]

impl PartialOrd<LicensedComponent> for LicensedComponent[src]

impl StructuralPartialEq for LicensedComponent[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.