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 new() -> CompositeEngineConfig
pub fn new() -> CompositeEngineConfig
Starts from the default configuration.
Sourcepub fn with_rego_rules(
self,
rules: impl IntoIterator<Item = ExternalRuleSource>,
) -> CompositeEngineConfig
pub fn with_rego_rules( self, rules: impl IntoIterator<Item = ExternalRuleSource>, ) -> CompositeEngineConfig
Adds custom Rego rules layered on top of the built-in rules.
Sourcepub fn with_cel_rules(
self,
rules: impl IntoIterator<Item = ExternalRuleSource>,
) -> CompositeEngineConfig
pub fn with_cel_rules( self, rules: impl IntoIterator<Item = ExternalRuleSource>, ) -> CompositeEngineConfig
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>,
) -> CompositeEngineConfig
pub fn with_guard_rules( self, rules: impl IntoIterator<Item = ExternalRuleSource>, ) -> CompositeEngineConfig
Adds Guard DSL rules layered on top of the built-in rules.
Sourcepub fn with_schema_validator_config(
self,
config: SchemaValidatorConfig,
) -> CompositeEngineConfig
pub fn with_schema_validator_config( self, config: SchemaValidatorConfig, ) -> CompositeEngineConfig
Sets the nested schema validator configuration so both the built-in and external evaluation observe the same additional schemas.
Trait Implementations§
Source§impl Clone for CompositeEngineConfig
impl Clone for CompositeEngineConfig
Source§fn clone(&self) -> CompositeEngineConfig
fn clone(&self) -> CompositeEngineConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for CompositeEngineConfig
impl Default for CompositeEngineConfig
Source§fn default() -> CompositeEngineConfig
fn default() -> CompositeEngineConfig
Source§impl<'de> Deserialize<'de> for CompositeEngineConfig
impl<'de> Deserialize<'de> for CompositeEngineConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CompositeEngineConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CompositeEngineConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for CompositeEngineConfig
impl Serialize for CompositeEngineConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for CompositeEngineConfig
impl RefUnwindSafe for CompositeEngineConfig
impl Send for CompositeEngineConfig
impl Sync for CompositeEngineConfig
impl Unpin for CompositeEngineConfig
impl UnsafeUnpin for CompositeEngineConfig
impl UnwindSafe for CompositeEngineConfig
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer