Skip to main content

Crate quarb_session

Crate quarb_session 

Source
Expand description

The backend-agnostic interactive Quarb session.

The session logic — the &N / &N! / &N# macro history, its resolution, and rendering coordination — is pure and depends on two pluggable seams:

  • an Executor: where the arbor materializes and queries run. LocalExecutor runs in-process (the native full fleet, or the wasm text-format subset); a daemon executor (native, elsewhere) proxies to a resident process.
  • a Store: where the session’s durable state persists — a file store on native, a browser store (localStorage) on wasm, or MemStore for none.

Results cross those seams as Cells — node results already rendered to their locator string, value results keeping their type — because a raw NodeId is meaningless across a socket or the JS boundary.

Re-exports§

pub use doc::Doc;
pub use doc::Options;

Modules§

doc
Opening a source into a queryable adapter, and running queries against it.

Structs§

DaemonExecutor
FileStore
A store persisting the macro history to a file under ~/.quarb, keyed by the source set — so restarting quai over the same sources restores its &N history. (Native only; the wasm build persists to localStorage instead.)
LocalExecutor
MemStore
The ephemeral store: no persistence, a fresh session every time.
Session
SessionState
The persistable part of a session: the macro history and the line counter. Frozen snapshots stay in memory for now — they regenerate on re-run, so persisting them is a later refinement.

Enums§

Cell
One result row, rendered so it can cross a process or JS boundary: a node as its locator string, a value keeping its type.

Traits§

Executor
The materialization + query substrate. Implementations run a query against a standing arbor and return rendered Cells.
Store
A place to load and save SessionState. MemStore keeps nothing (a fresh session each run); a file store (native) or a browser store (wasm, localStorage) persists. The caller keys the store by the session’s source identity.