pub struct ExecutionPlan {
pub spec_name: String,
pub data: IndexMap<DataPath, DataDefinition>,
pub rules: Vec<ExecutableRule>,
pub reference_evaluation_order: Vec<DataPath>,
pub meta: HashMap<String, MetaValue>,
pub named_types: BTreeMap<String, LemmaType>,
pub effective: EffectiveDate,
pub sources: SpecSources,
}Expand description
A complete execution plan ready for the evaluator
Contains the topologically sorted list of rules to execute, along with all data. Self-contained structure - no spec lookups required during evaluation.
Fields§
§spec_name: StringMain spec name
data: IndexMap<DataPath, DataDefinition>Per-data data in definition order: value, type-only, or spec reference.
rules: Vec<ExecutableRule>Rules to execute in topological order (sorted by dependencies)
reference_evaluation_order: Vec<DataPath>Order in which DataDefinition::Reference entries must be resolved
at evaluation time so that chained references (reference → reference →
data) copy values in the correct sequence. Empty when the plan has no
references.
meta: HashMap<String, MetaValue>Spec metadata
named_types: BTreeMap<String, LemmaType>Named types defined in or imported by this spec, in deterministic order.
effective: EffectiveDate§sources: SpecSourcesCanonical source for all specs in this plan, keyed by (name, effective_from). Reconstructed from AST — not raw file content.
Implementations§
Source§impl ExecutionPlan
impl ExecutionPlan
Sourcepub fn schema(&self) -> SpecSchema
pub fn schema(&self) -> SpecSchema
Build a SpecSchema describing this plan’s public IO contract.
Only data transitively reachable from at least one local rule (via
needs_data) are included. Spec-reference data (which have no schema
type) are also excluded. Only local rules (no cross-spec segments) are
included. Data and rules are sorted by source position (definition
order).
Sourcepub fn schema_for_rules(
&self,
rule_names: &[String],
) -> Result<SpecSchema, Error>
pub fn schema_for_rules( &self, rule_names: &[String], ) -> Result<SpecSchema, Error>
Build a SpecSchema scoped to specific rules.
The returned schema contains only the data needed by the given rules
(transitively, via needs_data) and only those rules. This is the
“what do I need to evaluate these rules?” view.
Data are sorted by source position (definition order).
Returns Err if any rule name is not found in the plan.
Sourcepub fn get_data_path_by_str(&self, name: &str) -> Option<&DataPath>
pub fn get_data_path_by_str(&self, name: &str) -> Option<&DataPath>
Look up a data by its input key (e.g., “age” or “rules.base_price”).
Sourcepub fn get_rule(&self, name: &str) -> Option<&ExecutableRule>
pub fn get_rule(&self, name: &str) -> Option<&ExecutableRule>
Look up a local rule by its name (rule in the main spec).
Sourcepub fn get_rule_by_path(&self, rule_path: &RulePath) -> Option<&ExecutableRule>
pub fn get_rule_by_path(&self, rule_path: &RulePath) -> Option<&ExecutableRule>
Look up a rule by its full path.
Sourcepub fn get_data_value(&self, path: &DataPath) -> Option<&LiteralValue>
pub fn get_data_value(&self, path: &DataPath) -> Option<&LiteralValue>
Get the literal value for a data path, if it exists and has a literal value.
Sourcepub fn with_data_values(
self,
values: HashMap<String, String>,
limits: &ResourceLimits,
) -> Result<Self, Error>
pub fn with_data_values( self, values: HashMap<String, String>, limits: &ResourceLimits, ) -> Result<Self, Error>
Provide string values for data.
Parses each string to its expected type, validates constraints, and applies to the plan.
Trait Implementations§
Source§impl Clone for ExecutionPlan
impl Clone for ExecutionPlan
Source§fn clone(&self) -> ExecutionPlan
fn clone(&self) -> ExecutionPlan
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExecutionPlan
impl Debug for ExecutionPlan
Source§impl<'de> Deserialize<'de> for ExecutionPlan
impl<'de> Deserialize<'de> for ExecutionPlan
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ExecutionPlan
impl RefUnwindSafe for ExecutionPlan
impl Send for ExecutionPlan
impl Sync for ExecutionPlan
impl Unpin for ExecutionPlan
impl UnsafeUnpin for ExecutionPlan
impl UnwindSafe for ExecutionPlan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more