Skip to main content

Module data

Module data 

Source
Expand description

Computed data: the typed tables that pipeline stages write beside the frozen trees, and the store that holds them during a run.

A table is typed data that one stage writes beside the frozen trees and other stages read; its identity is its registered dotted name, never its Rust type, and that name is also a capability, the capability of the table having been written (Table). Examples are a map of labels, a set of resolved references, a document-wide count and an output’s artifact set (ArtifactSet). Tables exist because the document’s trees are frozen once the rewrite stages have run: a stage that runs later cannot write into a tree, so it records what it computes in a table; see frozen trees and computed data.

The store is a run’s collection of computed tables: one writer per table, a declared write always installs a value, and every read and write is checked against the stage’s declarations at the access site (Computed). A Run owns one store; a stage reads it through a checked view and writes into a collector that the run folds into the store.

A feature author declares a table with FeatureBuilder::table, implements Table on its value type, and reads and writes it from a stage through StageCx::get and StageOut::table. An embedding program reads a table after a run with Run::table.

§Module map

  • table: what a table is and how it is referred to. The trait Table on a table’s value type; the declaration TableDef; TableType, a value type’s identity and operations captured for type-erased use; the registry-assigned number TableId; and the typed table keys TableName<T> (a name fixed at compile time) and TableHandle<T> (a name known only at run time).
  • store: the store and the access to it. Computed, one version of the store; ComputedView, a stage’s read view, checked against the reads the stage declared; StageOut, a stage’s write collector; and fold_outs, which the runner uses to fold the collectors into the store.

The addresses that tables are keyed by, TreeId and NodeAddr, are defined in crate::model::addr.

Modules§

store
The store of computed tables, and the checked access through which a stage reads and writes it.
table
Tables and the ways to refer to them: the trait Table that a table’s value type implements, the declaration TableDef, the captured value type TableType, the registry-assigned number TableId, and the typed table keys TableName<T> and TableHandle<T>.