pub struct CompositeEngineConfig {
pub rego_rules: Vec<ExternalRuleSource>,
pub cel_rules: Vec<ExternalRuleSource>,
pub guard_rules: Vec<ExternalRuleSource>,
pub schema_validator_config: Option<SchemaValidatorConfig>,
}Expand description
Configuration for a composite engine that evaluates the built-in rules with one engine and caller-supplied external rules with another.
The built-in rules are always evaluated, so this config only carries the external rules layered on top plus the shared schema configuration. Custom rules can be supplied in all three formats: Rego rules are evaluated by the external engine, while CEL custom rules and Guard rules are evaluated by the engine that owns the built-ins. It has no field for engine-native built-in custom rules because the composite fixes which engine owns the built-ins.
Fields§
§rego_rules: Vec<ExternalRuleSource>Custom Rego rules layered on top of the built-in rules.
cel_rules: Vec<ExternalRuleSource>Custom CEL rules layered on top of the built-in rules. They are evaluated by the same engine that owns the built-ins, since CEL custom rules are a CEL-engine feature.
guard_rules: Vec<ExternalRuleSource>Guard DSL rules as raw source text, layered on top of the built-in rules.
schema_validator_config: Option<SchemaValidatorConfig>Optional schema validator configuration. A standalone engine derives its schema-aware rule metadata from this config. Language APIs also use it to construct the schema validator bundled with the engine, so both components observe the same additional schemas.
Implementations§
Source§impl CompositeEngineConfig
impl CompositeEngineConfig
Sourcepub fn with_rego_rules(
self,
rules: impl IntoIterator<Item = ExternalRuleSource>,
) -> Self
pub fn with_rego_rules( self, rules: impl IntoIterator<Item = ExternalRuleSource>, ) -> Self
Adds custom Rego rules layered on top of the built-in rules.
Sourcepub fn with_cel_rules(
self,
rules: impl IntoIterator<Item = ExternalRuleSource>,
) -> Self
pub fn with_cel_rules( self, rules: impl IntoIterator<Item = ExternalRuleSource>, ) -> Self
Adds custom CEL rules layered on top of the built-in rules. They are evaluated by the engine that owns the built-ins.
Sourcepub fn with_guard_rules(
self,
rules: impl IntoIterator<Item = ExternalRuleSource>,
) -> Self
pub fn with_guard_rules( self, rules: impl IntoIterator<Item = ExternalRuleSource>, ) -> Self
Adds Guard DSL rules layered on top of the built-in rules.
Sourcepub fn with_schema_validator_config(self, config: SchemaValidatorConfig) -> Self
pub fn with_schema_validator_config(self, config: SchemaValidatorConfig) -> Self
Sets the nested schema validator configuration so both the built-in and external evaluation observe the same additional schemas.