pub struct RpmLicenseFilesParser;Expand description
Parser for RPM license files in /usr/share/licenses/ directories.
Identifies packages from their license files installed in the standard /usr/share/licenses/ location, primarily used in Mariner distroless containers.
§Supported Formats
/usr/share/licenses/*/COPYING*- COPYING license files/usr/share/licenses/*/LICENSE*- LICENSE files
§Key Features
- Extracts package name from directory path
- Supports Mariner distroless container convention
- Package URL generation with mariner namespace
§Implementation Notes
- Package name is extracted from the directory between
licenses/and the filename - For example:
/usr/share/licenses/openssl/LICENSE→ package name is “openssl” - Does NOT perform license detection (that’s handled by the license scanner)
- datasource_id: “rpm_package_licenses”
- namespace: “mariner”
Trait Implementations§
Source§impl PackageParser for RpmLicenseFilesParser
impl PackageParser for RpmLicenseFilesParser
Source§const PACKAGE_TYPE: PackageType = PACKAGE_TYPE
const PACKAGE_TYPE: PackageType = PACKAGE_TYPE
Package URL type identifier for this parser (e.g., PackageType::Npm, PackageType::Pypi).
Source§fn is_match(path: &Path) -> bool
fn is_match(path: &Path) -> bool
Checks if the given file path matches this parser’s expected format. Read more
Source§fn extract_packages(path: &Path) -> Vec<PackageData>
fn extract_packages(path: &Path) -> Vec<PackageData>
Extracts all packages from the given file path. Read more
Source§fn extract_first_package(path: &Path) -> PackageData
fn extract_first_package(path: &Path) -> PackageData
Returns the first package from
extract_packages(),
or a default PackageData if the file contains no packages.Auto Trait Implementations§
impl Freeze for RpmLicenseFilesParser
impl RefUnwindSafe for RpmLicenseFilesParser
impl Send for RpmLicenseFilesParser
impl Sync for RpmLicenseFilesParser
impl Unpin for RpmLicenseFilesParser
impl UnsafeUnpin for RpmLicenseFilesParser
impl UnwindSafe for RpmLicenseFilesParser
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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