Skip to main content

Crate sim_incremental_core

Crate sim_incremental_core 

Source
Expand description

Generic incremental query calculation for SIM runtime libraries.

sim-incremental-core records dependencies from actual query execution. A query can read another query through its QueryFrame, observe external stamps, and return any hashable Rust value. The engine keeps memoized values, reverse dependency edges, cycle paths, typed budget failures, continuation tokens, and bounded graph snapshots without depending on SIM expressions, codecs, Table/Dir storage, web surfaces, or expression-tree records.

§Examples

use sim_incremental_core::{IncrementalEngine, QueryResult};

let mut engine = IncrementalEngine::<&'static str, i64>::new();
engine.register_fn("a", |_, _| Ok(1));
engine.register_fn("b", |_, frame| {
    let a = frame.read("a")?;
    Ok(a + 1)
});

let value: QueryResult<_, _> = engine.verify("b");
assert_eq!(value.unwrap(), 2);

Structs§

ContinuationToken
An opaque handle that can resume a budget-stopped root query.
GraphSnapshot
A deterministic snapshot of memoized graph state.
IncrementalEngine
A dependency-light incremental query engine.
Observation
One dependency observation captured by a query frame.
Query
A registered query callback.
QueryBudgets
Limits applied while verifying queries.
QueryFrame
Execution context handed to a query callback.
RestoreReport
Summary of a snapshot restore operation.
Revision
A monotone revision stamp for memoized values and external observations.
SnapshotBudgets
Limits applied when exporting a graph snapshot.
SnapshotNode
One memo node inside a graph snapshot.
ValueFingerprint
A compact fingerprint for a memoized query value.

Enums§

BudgetKind
The resource class that exhausted a query run.
IncrementalError
A typed query verification failure.
ObservationKind
The reason a query depends on a key.
SnapshotError
A graph snapshot restore failure.

Traits§

FingerprintValue
Computes the fingerprint an incremental memo uses for cutoff.

Type Aliases§

QueryResult
The result type returned by query callbacks.