Struct tugger_licensing::LicensedComponent [−][src]
pub struct LicensedComponent { /* fields omitted */ }
Represents a software component with licensing information.
Implementations
impl LicensedComponent
[src]
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 Clone for LicensedComponent
[src]fn clone(&self) -> LicensedComponent
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl PartialEq<LicensedComponent> for LicensedComponent
[src]
impl PartialEq<LicensedComponent> for LicensedComponent
[src]fn eq(&self, other: &LicensedComponent) -> bool
[src]
fn ne(&self, other: &LicensedComponent) -> bool
[src]
Auto Trait Implementations
impl RefUnwindSafe for LicensedComponent
impl RefUnwindSafe for LicensedComponent
impl Send for LicensedComponent
impl Send for LicensedComponent
impl Sync for LicensedComponent
impl Sync for LicensedComponent
impl Unpin for LicensedComponent
impl Unpin for LicensedComponent
impl UnwindSafe for LicensedComponent
impl UnwindSafe for LicensedComponent