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§
- Continuation
Token - An opaque handle that can resume a budget-stopped root query.
- Graph
Snapshot - A deterministic snapshot of memoized graph state.
- Incremental
Engine - A dependency-light incremental query engine.
- Observation
- One dependency observation captured by a query frame.
- Query
- A registered query callback.
- Query
Budgets - Limits applied while verifying queries.
- Query
Frame - Execution context handed to a query callback.
- Restore
Report - Summary of a snapshot restore operation.
- Revision
- A monotone revision stamp for memoized values and external observations.
- Snapshot
Budgets - Limits applied when exporting a graph snapshot.
- Snapshot
Node - One memo node inside a graph snapshot.
- Value
Fingerprint - A compact fingerprint for a memoized query value.
Enums§
- Budget
Kind - The resource class that exhausted a query run.
- Incremental
Error - A typed query verification failure.
- Observation
Kind - The reason a query depends on a key.
- Snapshot
Error - A graph snapshot restore failure.
Traits§
- Fingerprint
Value - Computes the fingerprint an incremental memo uses for cutoff.
Type Aliases§
- Query
Result - The result type returned by query callbacks.