pub struct RuleApplicationEngine;Expand description
Rule application engine for matching and applying rules
Implementations§
Source§impl RuleApplicationEngine
impl RuleApplicationEngine
Sourcepub fn matches_pattern(rule: &Rule, context: &GenerationContext) -> bool
pub fn matches_pattern(rule: &Rule, context: &GenerationContext) -> bool
Check if a rule pattern matches a generation context
Sourcepub fn apply_rule(
rule: &Rule,
context: &GenerationContext,
) -> RuleApplicationResult
pub fn apply_rule( rule: &Rule, context: &GenerationContext, ) -> RuleApplicationResult
Apply a single rule to a generation context
Sourcepub fn apply_rules(
rules: &[Rule],
context: &GenerationContext,
) -> Vec<RuleApplicationResult>
pub fn apply_rules( rules: &[Rule], context: &GenerationContext, ) -> Vec<RuleApplicationResult>
Apply multiple rules to a generation context
Sourcepub fn apply_rules_with_precedence(
rules: &[Rule],
context: &GenerationContext,
) -> Option<RuleApplicationResult>
pub fn apply_rules_with_precedence( rules: &[Rule], context: &GenerationContext, ) -> Option<RuleApplicationResult>
Apply rules and get the highest confidence matched rule
Sourcepub fn chain_rules(
rules: &[Rule],
context: &GenerationContext,
) -> Result<Vec<RuleApplicationResult>>
pub fn chain_rules( rules: &[Rule], context: &GenerationContext, ) -> Result<Vec<RuleApplicationResult>>
Chain multiple rules together
Sourcepub fn compose_rules(
rules: &[Rule],
context: &GenerationContext,
) -> Result<Option<String>>
pub fn compose_rules( rules: &[Rule], context: &GenerationContext, ) -> Result<Option<String>>
Compose multiple rules into a single action
Sourcepub fn validate_rule_application(
rule: &Rule,
context: &GenerationContext,
) -> Result<()>
pub fn validate_rule_application( rule: &Rule, context: &GenerationContext, ) -> Result<()>
Validate that a rule can be applied to a context
Sourcepub fn get_matching_rules(
rules: &[Rule],
context: &GenerationContext,
) -> Vec<Rule>
pub fn get_matching_rules( rules: &[Rule], context: &GenerationContext, ) -> Vec<Rule>
Get all matching rules for a context
Sourcepub fn get_matching_rules_sorted(
rules: &[Rule],
context: &GenerationContext,
) -> Vec<Rule>
pub fn get_matching_rules_sorted( rules: &[Rule], context: &GenerationContext, ) -> Vec<Rule>
Get matching rules sorted by confidence
Sourcepub fn get_matching_rules_by_usage(
rules: &[Rule],
context: &GenerationContext,
) -> Vec<Rule>
pub fn get_matching_rules_by_usage( rules: &[Rule], context: &GenerationContext, ) -> Vec<Rule>
Get matching rules sorted by usage
Sourcepub fn get_matching_rules_by_success(
rules: &[Rule],
context: &GenerationContext,
) -> Vec<Rule>
pub fn get_matching_rules_by_success( rules: &[Rule], context: &GenerationContext, ) -> Vec<Rule>
Get matching rules sorted by success rate
Auto Trait Implementations§
impl Freeze for RuleApplicationEngine
impl RefUnwindSafe for RuleApplicationEngine
impl Send for RuleApplicationEngine
impl Sync for RuleApplicationEngine
impl Unpin for RuleApplicationEngine
impl UnwindSafe for RuleApplicationEngine
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