pub struct RuleExecutor { /* private fields */ }Expand description
Rule executor for backward chaining
Implementations§
Source§impl RuleExecutor
impl RuleExecutor
Sourcepub fn new(knowledge_base: KnowledgeBase) -> Self
pub fn new(knowledge_base: KnowledgeBase) -> Self
Create a new rule executor
Sourcepub fn try_execute_rule(&self, rule: &Rule, facts: &mut Facts) -> Result<bool>
pub fn try_execute_rule(&self, rule: &Rule, facts: &mut Facts) -> Result<bool>
Check if rule conditions are satisfied and execute if they are
Returns:
- Ok(true) if rule executed successfully
- Ok(false) if conditions not satisfied
- Err if execution failed
Sourcepub fn evaluate_conditions(
&self,
group: &ConditionGroup,
facts: &Facts,
) -> Result<bool>
pub fn evaluate_conditions( &self, group: &ConditionGroup, facts: &Facts, ) -> Result<bool>
Evaluate condition group
Auto Trait Implementations§
impl Freeze for RuleExecutor
impl !RefUnwindSafe for RuleExecutor
impl Send for RuleExecutor
impl Sync for RuleExecutor
impl Unpin for RuleExecutor
impl !UnwindSafe for RuleExecutor
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