pub struct Program { /* private fields */ }Implementations§
Source§impl Program
impl Program
Sourcepub fn from_values(
functions: Vec<ProgramFunction>,
bindings: Vec<(Pattern, ProgramValue)>,
final_report: ProgramValue,
limits: ProgramLimits,
) -> Result<Self, QueryError>
pub fn from_values( functions: Vec<ProgramFunction>, bindings: Vec<(Pattern, ProgramValue)>, final_report: ProgramValue, limits: ProgramLimits, ) -> Result<Self, QueryError>
Construct a pure report without parsing generated source. Native leaves
use shared expressions with ProgramNative stages and native set
operators. Query leaves own domain syntax; ordering selectors retain
their singleton input and the caller’s query range.
All input trees transfer to this call, including on failure. Preparation against the current input/model happens during ordinary evaluation.
§Errors
Unsupported constructs, duplicate names and exhausted construction bounds retain caller-supplied ranges. Evaluation also checks scope, purity, pattern compatibility and native types before executing statements.
Source§impl Program
impl Program
Sourcepub fn parse(source: &str, limits: ProgramLimits) -> Result<Self, QueryError>
pub fn parse(source: &str, limits: ProgramLimits) -> Result<Self, QueryError>
Parse immutable bindings, reports, or one terminal data edit batch. All names, terminal emitters and supported result transitions are checked before any statement executes.
pub fn is_editing(&self) -> bool
pub fn requires_model_facts(&self) -> bool
pub fn evaluate<'a>( &self, input: &'a Input, limits: ProgramLimits, ) -> Result<ProgramResult<'a>, QueryError>
pub fn evaluate_with_model<'a>( &self, input: &'a Input, model: Option<&'a ModelContext>, limits: ProgramLimits, ) -> Result<ProgramResult<'a>, QueryError>
pub fn evaluate_with_facts<'a>( &self, input: &'a Input, facts: Rc<ModelFacts<'a>>, limits: ProgramLimits, ) -> Result<ProgramResult<'a>, QueryError>
Sourcepub fn with_function_limits(self, limits: FunctionLimits) -> Self
pub fn with_function_limits(self, limits: FunctionLimits) -> Self
Set the independent active function depth; compatible tail calls reuse it.
Sourcepub fn parameters(&self) -> &[ParameterDeclaration]
pub fn parameters(&self) -> &[ParameterDeclaration]
Required scalar declarations retained by this program.
Sourcepub fn evaluate_with_parameters<'a>(
&self,
input: &'a Input,
parameters: ParameterInputs<'_>,
limits: ProgramLimits,
) -> Result<ProgramResult<'a>, QueryError>
pub fn evaluate_with_parameters<'a>( &self, input: &'a Input, parameters: ParameterInputs<'_>, limits: ProgramLimits, ) -> Result<ProgramResult<'a>, QueryError>
Admit the complete caller set before native/model execution.