Skip to main content

RegoEngine

Struct RegoEngine 

Source
pub struct RegoEngine { /* private fields */ }

Implementations§

Source§

impl RegoEngine

Source

pub fn new(config: EngineConfig) -> Result<Self>

Source

pub fn new_external_only(config: EngineConfig) -> Result<Self>

Constructs an engine that evaluates only the caller-supplied custom and Guard rules, without loading or advertising the handwritten built-in policies. Embedded data tables and custom builtins remain available so external rules can call them.

This backs the composite engine, whose built-in rules are owned by a separate engine; loading them here too would double-evaluate them.

Trait Implementations§

Source§

impl ValidationEngine for RegoEngine

Source§

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

Returns Guard rule metadata merged with any custom Rego rule metadata discovered from prior evaluations. Custom diagnostics already carry their current evaluation’s rule description, so this accumulated metadata cannot overwrite a later report.

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> 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> 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