pub struct RuleEngine { /* private fields */ }Expand description
High-performance rule engine
Implementations§
Source§impl RuleEngine
impl RuleEngine
Sourcepub fn evaluate(&mut self, context: &RuleContext) -> Vec<RuleResult>
pub fn evaluate(&mut self, context: &RuleContext) -> Vec<RuleResult>
Evaluate all rules against context
Sourcepub fn evaluate_matching(&mut self, context: &RuleContext) -> Vec<RuleResult>
pub fn evaluate_matching(&mut self, context: &RuleContext) -> Vec<RuleResult>
Evaluate and return only matching rules
Sourcepub fn evaluate_first(&mut self, context: &RuleContext) -> Option<RuleResult>
pub fn evaluate_first(&mut self, context: &RuleContext) -> Option<RuleResult>
Evaluate until first match
Sourcepub fn would_match(&self, rule_id: &str, context: &RuleContext) -> bool
pub fn would_match(&self, rule_id: &str, context: &RuleContext) -> bool
Check if a specific rule would match
Sourcepub fn stats(&self) -> RuleEngineStats
pub fn stats(&self) -> RuleEngineStats
Get statistics
Sourcepub fn reset_execution_state(&mut self)
pub fn reset_execution_state(&mut self)
Reset execution state (cooldowns and rate limits)
Trait Implementations§
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