moonrockz/rego/vm does not have a README file

    EngineError

    pub(all) suberror EngineError {
    InvalidBudget(limit~ : Int)
    } derive(Eq,
    Debug
    )

    Raised when constructing engine configuration values breaks a domain rule.
    impl Show for EngineError

    EvalError

    pub(all) suberror EvalError {
    BudgetExceeded(limit~ : Int)
    Conflict(path~ : String, message~ : String)
    BuiltinFailure(name~ : String, message~ : String)
    } derive(Eq,
    Debug
    )

    Raised when Plan VM evaluation fails with a runtime error.
    impl Show for EvalError

    BindingSet

    type BindingSet derive(Eq,
    Debug
    )

    One immutable solution row returned by evaluating a Rego v1 query.

    BindingSet::bindings

    fn BindingSet::bindings(self : BindingSet) -> ReadOnlyArray[(String,
    Value
    )]

    Returns all variable bindings (name, value) in this solution row.

    BindingSet::expressions

    fn BindingSet::expressions(self : BindingSet) -> ReadOnlyArray[
    Value
    ]

    Returns all top-level expression values in this solution row.

    BindingSet::get

    fn BindingSet::get(self : BindingSet, name : String) ->
    Value
    ?

    Looks up a variable binding by name in this solution row.

    BindingSet::value

    Returns the value of the first top-level expression, if any.

    EngineOptions

    type EngineOptions

    Immutable options controlling Plan VM evaluation.

    EngineOptions::builtins

    Returns the configured built-in registry.

    EngineOptions::clock

    Returns the configured deterministic Clock.

    EngineOptions::default

    fn EngineOptions::default() -> EngineOptions

    Returns default engine options (StepBudget::default(), standard Tier-1 + Tier-2 pure built-ins, epoch Clock, default deterministic RandomSeed, and standard OPA soft-undefined built-in error behavior).

    EngineOptions::random_seed

    Returns the configured deterministic RandomSeed.

    EngineOptions::step_budget

    fn EngineOptions::step_budget(self : EngineOptions) -> StepBudget

    Returns the configured step budget.

    EngineOptions::strict_builtin_errors

    fn EngineOptions::strict_builtin_errors(self : EngineOptions) -> Bool

    Reports whether built-in errors abort evaluation instead of returning undefined.

    EngineOptions::with_builtins

    Returns a copy of these options with a custom BuiltinRegistry.

    EngineOptions::with_clock

    Returns a copy of these options with an explicit injected Clock.

    EngineOptions::with_random_seed

    Returns a copy of these options with an explicit injected RandomSeed.

    EngineOptions::with_step_budget

    fn EngineOptions::with_step_budget(self : EngineOptions, step_budget : StepBudget) -> EngineOptions

    Returns a copy of these options with a different StepBudget.

    EngineOptions::with_strict_builtin_errors

    fn EngineOptions::with_strict_builtin_errors(self : EngineOptions, strict : Bool) -> EngineOptions

    Returns a copy of these options with strict_builtin_errors toggled.

    EvalResult

    type EvalResult derive(Eq,
    Debug
    )

    Immutable result set produced by evaluating a Rego v1 query on the Plan VM.

    EvalResult::first_value

    Returns the first expression value of the first solution row, if defined.

    EvalResult::is_defined

    fn EvalResult::is_defined(self : EvalResult) -> Bool

    Reports whether the query produced at least one solution.

    EvalResult::is_empty

    fn EvalResult::is_empty(self : EvalResult) -> Bool

    Reports whether the query produced zero solutions (undefined).

    EvalResult::length

    fn EvalResult::length(self : EvalResult) -> Int

    Number of solution rows produced by the query.

    EvalResult::rows

    fn EvalResult::rows(self : EvalResult) -> ReadOnlyArray[BindingSet]

    Returns all solution rows produced by the query.

    StepBudget

    A validated positive deterministic instruction step limit for the Plan VM.

    StepBudget::StepBudget

    fn StepBudget::StepBudget(limit : Int) -> StepBudget raise EngineError

    Constructs a validated StepBudget, rejecting non-positive limits.

    StepBudget::default

    fn StepBudget::default() -> StepBudget

    Returns the default StepBudget (100,000 VM steps).

    StepBudget::limit

    fn StepBudget::limit(self : StepBudget) -> Int

    Returns the maximum number of VM steps permitted by this budget.

    eval_query

    Evaluates a compiled Rego v1 query against a CompiledPolicy, optional input document, static data document, and EngineOptions.

    eval_rule

    Directly evaluates a data.<path...> rule or package document in policy. path holds arbitrary data object keys (ArrayView[String]), which have no character-set restrictions in Rego or JSON.

    Source Files