pub struct RuleEngine { /* private fields */ }Expand description
Rule engine evaluating rules against a fact map.
Implementations§
Source§impl RuleEngine
impl RuleEngine
pub fn new() -> Self
pub fn add_rule(&mut self, rule: Rule)
pub fn evaluate(&mut self, facts: &HashMap<String, String>) -> Vec<RuleAction>
pub fn set_enabled(&mut self, name: &str, enabled: bool) -> bool
pub fn remove_rule(&mut self, name: &str) -> bool
pub fn rule_count(&self) -> usize
pub fn enabled_count(&self) -> usize
pub fn fire_count(&self) -> u64
pub fn clear(&mut self)
pub fn rule_names(&self) -> Vec<&str>
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