RuleProvider

Trait RuleProvider 

Source
pub trait RuleProvider: Send + Sync {
    // Required methods
    fn provider_id(&self) -> &'static str;
    fn description(&self) -> &'static str;
    fn version(&self) -> &'static str;
    fn register_rules(&self, registry: &mut RuleRegistry);

    // Provided methods
    fn config_schema(&self) -> Option<Value> { ... }
    fn rule_ids(&self) -> Vec<&'static str> { ... }
    fn initialize(&self) -> Result<()> { ... }
    fn register_rules_with_config(
        &self,
        registry: &mut RuleRegistry,
        _config: Option<&Config>,
    ) { ... }
}
Expand description

Trait for rule providers to register rules with the engine

Required Methods§

Source

fn provider_id(&self) -> &'static str

Unique identifier for this rule provider

Source

fn description(&self) -> &'static str

Human-readable description of this rule provider

Source

fn version(&self) -> &'static str

Version of this rule provider

Source

fn register_rules(&self, registry: &mut RuleRegistry)

Register all rules from this provider with the registry

Provided Methods§

Source

fn config_schema(&self) -> Option<Value>

Provider-specific configuration schema

Source

fn rule_ids(&self) -> Vec<&'static str>

List of rule IDs that this provider registers

Source

fn initialize(&self) -> Result<()>

Provider initialization hook

Source

fn register_rules_with_config( &self, registry: &mut RuleRegistry, _config: Option<&Config>, )

Register all rules from this provider with the registry, using configuration This method allows rules to be configured at registration time. The default implementation calls the legacy register_rules method for backward compatibility.

Implementors§