Skip to main content

Engine

Struct Engine 

Source
pub struct Engine {
    pub resilient: bool,
    pub profile_override: Option<String>,
    pub budget: Budget,
    pub env: HashMap<String, String>,
    pub env_fallback: Option<EnvLookup>,
}

Fields§

§resilient: bool§profile_override: Option<String>

CLI --profile override: when set, selects this profile instead of the document’s active_profile key (spec §3.5).

§budget: Budget

Runtime resource limits (spec/budgets.md, C-037). Violations are always fatal, in both modes.

§env: HashMap<String, String>

The closed environment snapshot: the ONLY external input evaluation may read (spec/reproducibility.md §1, C-050). new() snapshots the process environment (CLI-compatible); with_env injects a fixed map (tests, agents, replays).

§env_fallback: Option<EnvLookup>

Lazy host lookup consulted on snapshot miss, before defaults (F-016). None preserves legacy behavior exactly.

Implementations§

Source§

impl Engine

Source

pub fn new() -> Self

Source

pub fn hermetic() -> Self

Hermetic engine: identical to new() except the environment starts empty instead of snapshotting the process ambient. Embeddings (FFI, WASM) use this so host ambient can never leak across the boundary; host values arrive only through explicit maps or lookup callbacks. Required on platforms without a process environment (wasm32-unknown-unknown aborts on ambient access): construct here, never snapshot-then-discard.

Source

pub fn with_env(self, env: HashMap<String, String>) -> Self

Fixed environment snapshot instead of the process ambient.

Source

pub fn with_env_fallback(self, lookup: EnvLookup) -> Self

Lazy host lookup consulted on snapshot miss (F-016).

Source

pub fn evaluate( &self, module: &Module, ) -> Result<(Value, Vec<Diagnostic>), EvalError>

Source

pub fn evaluate_incremental( &self, module: &Module, memo: &mut IncrementalMemo, ) -> Result<(Value, Vec<Diagnostic>), EvalError>

Incremental evaluation over a reused memo store (C-055, spec/performance.md §2): nodes whose structural fingerprint (expression shape, literal data, env values read, and dependency fingerprints) matches a previous call serve the memoized value and diagnostics; only the affected sub-DAG re-evaluates. Configuration changes (resilient flag, profile override, budgets) clear the store first. Post-walk transforms (profiles, patches, validation) re-run every call — they compose the final tree and stay cheap relative to the walk they follow.

Trait Implementations§

Source§

impl Default for Engine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Engine

§

impl !Send for Engine

§

impl !Sync for Engine

§

impl !UnwindSafe for Engine

§

impl Freeze for Engine

§

impl Unpin for Engine

§

impl UnsafeUnpin for Engine

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> Same for T

Source§

type Output = T

Should always be Self
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.