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>
pub fn parse_rule(grl_text: &str) -> Result<Rule>
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_with_modules(grl_text: &str) -> Result<ParsedGRL>
pub fn parse_with_modules(grl_text: &str) -> Result<ParsedGRL>
Parse GRL text with module support
Example:
defmodule SENSORS {
export: all
}
defmodule CONTROL {
import: SENSORS (rules * (templates temperature))
}
rule "CheckTemp" {
when temperature.value > 28
then println("Hot");
}Auto Trait Implementations§
impl Freeze for GRLParser
impl RefUnwindSafe for GRLParser
impl Send for GRLParser
impl Sync for GRLParser
impl Unpin for GRLParser
impl UnsafeUnpin 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