pub struct LicensedComponents { /* private fields */ }
Expand description
A collection of licensed components.
Implementations§
Source§impl LicensedComponents
impl LicensedComponents
Sourcepub fn into_components(self) -> impl Iterator<Item = LicensedComponent>
pub fn into_components(self) -> impl Iterator<Item = LicensedComponent>
Obtain an iterator over the components, consuming self.
Sourcepub fn iter_components(&self) -> impl Iterator<Item = &LicensedComponent>
pub fn iter_components(&self) -> impl Iterator<Item = &LicensedComponent>
Iterate over components in this collection.
Sourcepub fn add_component(&mut self, component: LicensedComponent)
pub fn add_component(&mut self, component: LicensedComponent)
Add a component to this collection.
Sourcepub fn add_spdx_only_component(
&mut self,
component: LicensedComponent,
) -> Result<()>
pub fn add_spdx_only_component( &mut self, component: LicensedComponent, ) -> Result<()>
Add a component to this collection, but only if it only contains SPDX license identifiers.
Sourcepub fn has_python_module(&self, name: &str) -> bool
pub fn has_python_module(&self, name: &str) -> bool
Whether a Python module exists in the collection.
Sourcepub fn normalize_python_modules(&self) -> Self
pub fn normalize_python_modules(&self) -> Self
Adjusts Python modules in the components set.
Standard library modules that have identical licensing to the Python distribution are removed.
Missing top-level packages are added with an unknown license annotation.
Modules that aren’t top-level modules are removed.
Sourcepub fn all_spdx_licenses(&self) -> BTreeSet<(LicenseId, Option<ExceptionId>)>
pub fn all_spdx_licenses(&self) -> BTreeSet<(LicenseId, Option<ExceptionId>)>
Obtain all SPDX license identifiers referenced by registered components.
Sourcepub fn all_spdx_license_ids(&self) -> BTreeSet<LicenseId>
pub fn all_spdx_license_ids(&self) -> BTreeSet<LicenseId>
Obtain all SPDX license IDs referenced by all components.
Unlike Self::all_spdx_licenses(), this returns just the LicenseId, without exceptions.
Sourcepub fn all_spdx_license_names(&self, full: bool) -> Vec<String>
pub fn all_spdx_license_names(&self, full: bool) -> Vec<String>
Obtain all SPDX license names referenced by registered components.
Sourcepub fn components_by_spdx_license(
&self,
) -> BTreeMap<(LicenseId, Option<ExceptionId>), BTreeSet<&LicensedComponent>>
pub fn components_by_spdx_license( &self, ) -> BTreeMap<(LicenseId, Option<ExceptionId>), BTreeSet<&LicensedComponent>>
Obtain a mapping of all SPDX licenses to components having them.
Sourcepub fn license_spdx_components(
&self,
) -> impl Iterator<Item = &LicensedComponent>
pub fn license_spdx_components( &self, ) -> impl Iterator<Item = &LicensedComponent>
Obtain all components with valid SPDX license expressions.
Sourcepub fn license_missing_components(
&self,
) -> impl Iterator<Item = &LicensedComponent>
pub fn license_missing_components( &self, ) -> impl Iterator<Item = &LicensedComponent>
Obtain components that are missing license annotations.
Sourcepub fn license_public_domain_components(
&self,
) -> impl Iterator<Item = &LicensedComponent>
pub fn license_public_domain_components( &self, ) -> impl Iterator<Item = &LicensedComponent>
Obtain components that are licensed to the public domain.
Sourcepub fn license_unknown_components(
&self,
) -> impl Iterator<Item = &LicensedComponent>
pub fn license_unknown_components( &self, ) -> impl Iterator<Item = &LicensedComponent>
Obtain components that have unknown licensing.
There is a value for the license but that license is not recognized by us.
Sourcepub fn license_copyleft_components(
&self,
) -> impl Iterator<Item = &LicensedComponent>
pub fn license_copyleft_components( &self, ) -> impl Iterator<Item = &LicensedComponent>
Components that have copyleft licenses.
There may be false negatives if the component doesn’t have fully SPDX parsed licenses.
Sourcepub fn license_summary(&self) -> String
pub fn license_summary(&self) -> String
Generate a text summary of licesning info.
Sourcepub fn interesting_report(&self) -> Option<String>
pub fn interesting_report(&self) -> Option<String>
Generate a text report of noteworthy licensing info.
This essentially emits license quirks that may warrant user attention.
Sourcepub fn spdx_license_breakdown(&self) -> String
pub fn spdx_license_breakdown(&self) -> String
Generate a summary of SPDX licenses in all components.
Trait Implementations§
Source§impl Clone for LicensedComponents
impl Clone for LicensedComponents
Source§fn clone(&self) -> LicensedComponents
fn clone(&self) -> LicensedComponents
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for LicensedComponents
impl Debug for LicensedComponents
Source§impl Default for LicensedComponents
impl Default for LicensedComponents
Source§fn default() -> LicensedComponents
fn default() -> LicensedComponents
Source§impl PartialEq for LicensedComponents
impl PartialEq for LicensedComponents
impl Eq for LicensedComponents
impl StructuralPartialEq for LicensedComponents
Auto Trait Implementations§
impl Freeze for LicensedComponents
impl RefUnwindSafe for LicensedComponents
impl Send for LicensedComponents
impl Sync for LicensedComponents
impl Unpin for LicensedComponents
impl UnwindSafe for LicensedComponents
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more