Skip to main content

ExprTreeCalc

Struct ExprTreeCalc 

Source
pub struct ExprTreeCalc { /* private fields */ }
Expand description

Incremental calculator for ordinary SIM Expr sources and Value results.

Implementations§

Source§

impl ExprTreeCalc

Source

pub fn edit_cell_source( &mut self, path: TablePath, input: Input, caller_policy: ReadPolicy, ) -> SourceEditOutcome

Decodes edited source through the inherited installed codec under explicit position, limits, caller trust, and diminished cell authority.

A rejected edit leaves the prior source unchanged.

Source

pub fn source_face(&self, path: &TablePath) -> EncodedFace

Encodes the authored source expression under its inherited codec, position, and source-only face budget.

Source

pub fn result_face(&self, path: &TablePath) -> EncodedFace

Encodes the current arbitrary result under its inherited codec, position, and result-only face budget.

The ordinary Value remains in the calculator regardless of whether it has a safe bounded presentation projection.

Source§

impl ExprTreeCalc

Source

pub fn persist_derived( &mut self, derived: &mut DerivedTableAdapter<'_>, ) -> Result<DerivedPersistReport, DerivedSnapshotError>

Writes graph observations, reverse edges, memos, receipts, and scheduler continuations to the derived Table.

Source

pub fn restore_derived( &mut self, derived: &mut DerivedTableAdapter<'_>, ) -> Result<DerivedRestoreReport, DerivedSnapshotError>

Opens a valid derived graph or conservatively rebuilds it.

Missing, corrupt, incompatible, and source/control-mismatched records are deleted and treated as a cache miss. Authored source and operational control state are never changed by this operation.

Source§

impl ExprTreeCalc

Source

pub fn attach_refresh_source( &mut self, path: &TablePath, source: Arc<dyn MountRefreshSource>, ) -> Result<(), RefreshError>

Attaches an explicit refresh sampler to an existing mount.

Registration does not sample the backend. The source remains idle until Self::refresh is called.

Source

pub fn detach_refresh_source( &mut self, path: &TablePath, ) -> Option<Arc<dyn MountRefreshSource>>

Detaches and returns an explicit refresh sampler.

Source

pub fn refresh(&mut self) -> Result<RefreshReport, RefreshError>

Explicitly samples every non-watch mount and invalidates changed inputs.

Sampling completes before graph or control state is mutated. If any backend fails, the refresh is rejected atomically and no observation is advanced.

Source§

impl ExprTreeCalc

Source

pub fn set_tree_codec_policy(&mut self, patch: CodecPolicyPatch)

Replaces the tree-level codec policy patch.

Source

pub fn set_dir_codec_policy( &mut self, directory: TablePath, patch: CodecPolicyPatch, )

Replaces one directory-level codec policy patch.

Source

pub fn set_cell_codec_policy( &mut self, cell: TablePath, patch: CodecPolicyPatch, )

Replaces one cell-level codec policy patch.

Source

pub fn effective_codec_policy(&self, cell: &TablePath) -> EffectiveCodecPolicy

Resolves codec policy field by field from tree through ancestor directories to the selected cell.

Source

pub fn set_tree_calc_policy(&mut self, patch: CalcPolicyPatch)

Replaces the tree-level calculation policy patch.

Source

pub fn set_dir_calc_policy( &mut self, directory: TablePath, patch: CalcPolicyPatch, )

Replaces one directory-level calculation policy patch.

Source

pub fn set_cell_calc_policy(&mut self, cell: TablePath, patch: CalcPolicyPatch)

Replaces one cell-level calculation policy patch.

Source

pub fn effective_calc_policy(&self, cell: &TablePath) -> EffectiveCalcPolicy

Resolves tree, ancestor-directory, and cell calculation policy fields.

Source

pub fn set_tree_authority_policy(&mut self, patch: AuthorityPolicyPatch)

Replaces the tree-level authority policy patch.

Source

pub fn set_dir_authority_policy( &mut self, directory: TablePath, patch: AuthorityPolicyPatch, )

Replaces one directory-level authority policy patch.

Source

pub fn set_cell_authority_policy( &mut self, cell: TablePath, patch: AuthorityPolicyPatch, )

Replaces one cell-level authority policy patch.

Source

pub fn effective_authority(&self, cell: &TablePath) -> EffectiveAuthority

Resolves the immutable ceiling through every allow/deny policy level.

Source

pub fn set_codec_registry_revision(&mut self, revision: u64)

Updates the observed codec registry revision.

Source

pub fn mount( &mut self, path: TablePath, resource: MountResource, backend: BackendKind, epoch: MountEpoch, )

Adds or replaces a mounted backend observation.

Source

pub fn unmount(&mut self, path: &TablePath) -> bool

Removes a mounted backend observation and its refresh state.

Source

pub fn observe_mount_epoch(&mut self, path: &TablePath, epoch: MountEpoch)

Advances a mounted backend epoch.

Source

pub fn request_cancellation(&self)

Requests cancellation of the next calculation work that actually runs.

Source

pub fn verify_cell(&mut self, path: &TablePath) -> Result<Value, CalcError>

Pull-verifies a cell under the hard default ceilings.

Source

pub fn verify_cell_with_limits( &mut self, path: &TablePath, limits: CalcLimits, ) -> Result<Value, CalcError>

Pull-verifies a cell with requested limits clamped to hard ceilings.

Source

pub fn recalculate_cell(&mut self, path: &TablePath) -> Result<Value, CalcError>

Forces only this root while permitting valid dependency reuse.

Source

pub fn recalculate_cell_with_limits( &mut self, path: &TablePath, limits: CalcLimits, ) -> Result<Value, CalcError>

Forces only this root under explicit hard-clamped limits.

Source

pub fn recalculate_recursive( &mut self, path: &TablePath, ) -> Result<Value, CalcError>

Forces this root and every reachable calculated dependency.

Source

pub fn calculate_cells( &mut self, roots: impl IntoIterator<Item = TablePath>, mode: CalcRequestMode, limits: CalcLimits, ) -> DirectedCalcReport

Runs one stable multi-root directed request through the shared engine.

Source

pub fn watch(&mut self, buffer_policy: BufferPolicy) -> CalcWatch

Opens one standard bounded stream endpoint for progress and changes.

Source

pub fn cancel_request(&mut self, request_id: RequestId) -> bool

Cancels queued automatic work with this request id.

Source

pub fn current_cell(&self, path: &TablePath) -> Result<Value, CalcError>

Reads only the current committed result.

A failed or cancelled recalculation never falls back to last-good.

Source

pub fn last_good_cell(&self, path: &TablePath) -> Option<LastGoodValue>

Returns the retained historical success, explicitly labelled last-good.

Source

pub fn current_is_volatile(&self, path: &TablePath) -> bool

Returns whether the current successful result is noncanonical and must therefore be treated as volatile.

Source

pub fn cell_revision(&self, path: &TablePath) -> Option<u64>

Returns the current incremental memo revision.

Source

pub fn cell_fingerprint(&self, path: &TablePath) -> Option<ValueFingerprint>

Returns the current incremental fingerprint.

Source

pub fn receipt(&self, path: &TablePath) -> Option<CalcReceipt>

Returns the latest bounded immutable calculation receipt.

Source

pub fn explain(&self, path: &TablePath) -> CalcExplanation

Explains current state without evaluating or mutating the graph.

Source

pub fn run_automatic( &mut self, budget: AutomaticBudget, now_ms: u64, ) -> AutomaticRun

Runs a bounded amount of ready automatic work.

Source

pub fn continue_automatic( &mut self, continuation: AutomaticContinuation, budget: AutomaticBudget, now_ms: u64, ) -> Result<AutomaticRun, CalcError>

Resumes a prior automatic queue continuation.

Source

pub fn automatic_queue_snapshot(&self) -> AutomaticQueueSnapshot

Snapshots all deterministic queue state needed for restart.

Source

pub fn restore_automatic_queue( &mut self, snapshot: AutomaticQueueSnapshot, ) -> Result<(), CalcError>

Restores a deterministic queue snapshot, rejecting duplicate cells.

Source§

impl ExprTreeCalc

Source

pub fn new() -> Self

Creates a calculator using strict eager ordinary SIM evaluation.

Source

pub fn with_context_factory<F>(factory: F) -> Self
where F: Fn() -> Cx + Send + Sync + 'static,

Creates a calculator from a fresh-context factory.

The factory may install loadable libraries, lexical values, functions, macros, tables, and directories. It is invoked with no calculator lock held.

Source

pub fn set_wall_clock<F>(&mut self, clock: F)
where F: Fn() -> Option<u64> + Send + Sync + 'static,

Replaces the optional human wall-clock observation source.

Logical ticks and revisions remain the only freshness authority.

Source

pub fn open_time_authority(&self) -> CapabilitySet

Returns the immutable capability ceiling captured when this tree opened.

Source

pub fn set_cell(&mut self, path: TablePath, source: Expr)

Installs or replaces an ordinary expression source.

Source

pub fn remove_cell(&mut self, path: &TablePath)

Removes a cell source while retaining an explicit missing-value query.

Source

pub fn move_cell(&mut self, from: &TablePath, to: TablePath)

Moves an ordinary source and invalidates both namespace locations.

Source

pub fn bind_name(&mut self, name: impl Into<String>)

Binds a lexical name to a diagnostic string value.

This compatibility helper keeps a name ahead of tree lookup. New code should prefer Self::bind_value.

Source

pub fn bind_value(&mut self, name: Symbol, value: Value)

Binds an arbitrary ordinary SIM value ahead of tree-name lookup.

Source

pub fn cell_dependencies( &mut self, path: &TablePath, ) -> Result<Vec<(CalcQuery, ObservationKind)>, IncrementalError<CalcQuery>>

Returns the dependency observations for a cell in deterministic order.

Trait Implementations§

Source§

impl Default for ExprTreeCalc

Source§

fn default() -> Self

Returns the “default value” for a type. 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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.