pub struct GRLParser;Expand description
GRL (Grule Rule Language) Parser Parses Grule-like syntax into Rule objects
Implementations§
Source§impl GRLParser
impl GRLParser
Sourcepub fn parse_rule(grl_text: &str) -> Result<Rule, RuleEngineError>
pub fn parse_rule(grl_text: &str) -> Result<Rule, RuleEngineError>
Parse a single rule from GRL syntax
Example GRL syntax:
rule CheckAge "Age verification rule" salience 10 {
when
User.Age >= 18 && User.Country == "US"
then
User.IsAdult = true;
Retract("User");
}Sourcepub fn parse_rules(grl_text: &str) -> Result<Vec<Rule>, RuleEngineError>
pub fn parse_rules(grl_text: &str) -> Result<Vec<Rule>, RuleEngineError>
Parse multiple rules from GRL text
Auto Trait Implementations§
impl Freeze for GRLParser
impl RefUnwindSafe for GRLParser
impl Send for GRLParser
impl Sync for GRLParser
impl Unpin for GRLParser
impl UnwindSafe for GRLParser
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