1use crate::rule::{Rule, RuleContext, RuleResult};
2use crate::runner::{
3 best_first_rule_runner::BestFirstRuleRunner, chain_rule_runner::ChainRuleRunner, RuleRunner,
4};
5
6pub struct Engine;
8
9impl Engine {
10 pub fn best_first_runner() -> BestFirstRuleRunner {
12 BestFirstRuleRunner
13 }
14
15 pub fn chain_runner() -> ChainRuleRunner {
17 ChainRuleRunner
18 }
19
20 pub fn execute_best_first(
22 context: &mut RuleContext,
23 rules: &mut [Box<dyn Rule>],
24 ) -> RuleResult<()> {
25 Self::best_first_runner().run(context, rules)
26 }
27
28 pub fn execute_chain(context: &mut RuleContext, rules: &mut [Box<dyn Rule>]) -> RuleResult<()> {
30 Self::chain_runner().run(context, rules)
31 }
32}