Skip to main content

Program

Struct Program 

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

Implementations§

Source§

impl Program

Source

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

Source

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.

Source

pub fn is_editing(&self) -> bool

Source

pub fn requires_model_facts(&self) -> bool

Source

pub fn evaluate<'a>( &self, input: &'a Input, limits: ProgramLimits, ) -> Result<ProgramResult<'a>, QueryError>

Source

pub fn evaluate_with_model<'a>( &self, input: &'a Input, model: Option<&'a ModelContext>, limits: ProgramLimits, ) -> Result<ProgramResult<'a>, QueryError>

Source

pub fn evaluate_with_facts<'a>( &self, input: &'a Input, facts: Rc<ModelFacts<'a>>, limits: ProgramLimits, ) -> Result<ProgramResult<'a>, QueryError>

Source

pub fn with_function_limits(self, limits: FunctionLimits) -> Self

Set the independent active function depth; compatible tail calls reuse it.

Source

pub fn parameters(&self) -> &[ParameterDeclaration]

Required scalar declarations retained by this program.

Source

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.

Source

pub fn evaluate_with_model_and_parameters<'a>( &self, input: &'a Input, model: Option<&'a ModelContext>, parameters: ParameterInputs<'_>, limits: ProgramLimits, ) -> Result<ProgramResult<'a>, QueryError>

Source

pub fn evaluate_with_facts_and_parameters<'a>( &self, input: &'a Input, facts: Rc<ModelFacts<'a>>, parameters: ParameterInputs<'_>, limits: ProgramLimits, ) -> Result<ProgramResult<'a>, QueryError>

Trait Implementations§

Source§

impl Debug for Program

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Program

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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