pub struct RuleEngine { /* private fields */ }Expand description
Engine for applying custom matching rules
Implementations§
Source§impl RuleEngine
impl RuleEngine
Sourcepub fn new(config: MatchingRulesConfig) -> Result<Self, String>
pub fn new(config: MatchingRulesConfig) -> Result<Self, String>
Create a new rule engine from configuration
Sourcepub fn apply(
&self,
components: &IndexMap<CanonicalId, Component>,
) -> RuleApplicationResult
pub fn apply( &self, components: &IndexMap<CanonicalId, Component>, ) -> RuleApplicationResult
Apply rules to a set of components
Sourcepub const fn config(&self) -> &MatchingRulesConfig
pub const fn config(&self) -> &MatchingRulesConfig
Get the configuration
Sourcepub fn is_excluded(&self, purl: &str) -> bool
pub fn is_excluded(&self, purl: &str) -> bool
Check if a PURL is excluded by any rule
Sourcepub fn get_canonical(&self, purl: &str) -> Option<String>
pub fn get_canonical(&self, purl: &str) -> Option<String>
Get the canonical PURL for a given PURL, if any equivalence applies
Auto Trait Implementations§
impl Freeze for RuleEngine
impl RefUnwindSafe for RuleEngine
impl Send for RuleEngine
impl Sync for RuleEngine
impl Unpin for RuleEngine
impl UnsafeUnpin for RuleEngine
impl UnwindSafe for RuleEngine
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