Skip to main content

CompositeEngine

Struct CompositeEngine 

Source
pub struct CompositeEngine { /* private fields */ }
Expand description

A validation engine that composes two engines: one owns the built-in rules, the other evaluates the caller-supplied Rego rules.

The built-in rules are always evaluated by the CEL engine, which also evaluates custom CEL rules (a CEL-engine feature) and Guard rules (which every engine evaluates through the shared Guard evaluator, so the built-in engine is as good a host as any). Custom Rego rules need a Rego engine, so one is built in external-only mode - contributing no built-in findings of its own - and only when the configuration supplies Rego rules. Findings from both are concatenated; the surrounding validation pipeline performs the single finalize pass (dedup, sort, filter, enrich).

Implementations§

Source§

impl CompositeEngine

Source

pub fn new(config: CompositeEngineConfig) -> Result<CompositeEngine, Error>

Builds the composite engine from a CompositeEngineConfig. The built-in engine is always constructed; the external engine is constructed only when the configuration supplies custom Rego rules.

Trait Implementations§

Source§

impl ValidationEngine for CompositeEngine

Source§

fn external_rule_metadata(&self) -> HashMap<String, RuleMetadataEntry>

The external rule metadata is the union of both engines’ external rules: custom CEL and Guard rules from the built-in engine and custom Rego rules from the external engine. The two sets have disjoint rule IDs, so a plain merge cannot drop or overwrite a rule.

Source§

fn engine_name(&self) -> &str

Source§

fn evaluate_rules( &self, model: &Arc<SemanticModel>, config: &ValidateConfig, ) -> Result<Vec<Diagnostic>, ValidationError>

Source§

fn list_rules(&self) -> Vec<RuleInfo>

Source§

fn rule_metadata(&self) -> &HashMap<String, RuleMetadataEntry>

Built-in rule metadata from the rules registry only.
Source§

fn init_metric(&self) -> &PhaseMetric

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyExt for T
where T: Any + ?Sized,

Source§

fn downcast_ref<T>(this: &Self) -> Option<&T>
where T: Any,

Attempts to downcast this to T behind reference
Source§

fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>
where T: Any,

Attempts to downcast this to T behind mutable reference
Source§

fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>
where T: Any,

Attempts to downcast this to T behind Rc pointer
Source§

fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>
where T: Any,

Attempts to downcast this to T behind Arc pointer
Source§

fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>
where T: Any,

Attempts to downcast this to T behind Box pointer
Source§

fn downcast_move<T>(this: Self) -> Option<T>
where T: Any, Self: Sized,

Attempts to downcast owned Self to T, useful only in generic context as a workaround for specialization
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T, X> CoerceTo<T> for X
where T: CoerceFrom<X> + ?Sized,

Source§

fn coerce_rc_to(self: Rc<X>) -> Rc<T>

Source§

fn coerce_box_to(self: Box<X>) -> Box<T>

Source§

fn coerce_ref_to(&self) -> &T

Source§

fn coerce_mut_to(&mut self) -> &mut T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V