pub struct RuleEngine { /* private fields */ }Expand description
Rule engine that evaluates rules against YAML data
Implementations§
Source§impl RuleEngine
impl RuleEngine
Sourcepub fn new() -> RuleEngine
pub fn new() -> RuleEngine
Create an empty rule engine
Sourcepub fn with_rules(rules: Vec<Rule>) -> RuleEngine
pub fn with_rules(rules: Vec<Rule>) -> RuleEngine
Create a rule engine with predefined rules
Sourcepub fn evaluate(&self, data: &Value) -> Vec<Diagnostic>
pub fn evaluate(&self, data: &Value) -> Vec<Diagnostic>
Evaluate all rules against data and return diagnostics
Sourcepub fn rule_count(&self) -> usize
pub fn rule_count(&self) -> usize
Get rule count
Trait Implementations§
Source§impl Default for RuleEngine
impl Default for RuleEngine
Source§fn default() -> RuleEngine
fn default() -> RuleEngine
Returns the “default value” for a type. Read more
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