pub struct PurlNormalizer;Expand description
PURL normalizer for consistent comparison.
Implementations§
Source§impl PurlNormalizer
impl PurlNormalizer
Sourcepub fn extract_name(&self, purl: &str) -> Option<String>
pub fn extract_name(&self, purl: &str) -> Option<String>
Extract package name from PURL
Sourcepub fn extract_version(&self, purl: &str) -> Option<String>
pub fn extract_version(&self, purl: &str) -> Option<String>
Extract version from PURL
Sourcepub fn extract_type(&self, purl: &str) -> Option<String>
pub fn extract_type(&self, purl: &str) -> Option<String>
Extract ecosystem type from PURL
Sourcepub fn same_package(&self, purl_a: &str, purl_b: &str) -> bool
pub fn same_package(&self, purl_a: &str, purl_b: &str) -> bool
Check if two PURLs refer to the same package (ignoring version)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PurlNormalizer
impl RefUnwindSafe for PurlNormalizer
impl Send for PurlNormalizer
impl Sync for PurlNormalizer
impl Unpin for PurlNormalizer
impl UnsafeUnpin for PurlNormalizer
impl UnwindSafe for PurlNormalizer
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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