Expand description
Read-side helpers for projection files.
Each read_* here reads exactly one file and is coherent on its own (atomic
rename — see crate::atomic). A caller that reads several files as one
logical view (e.g. manifest.json together with the nodes/,
discussions/, or spinoffs/ projection set, whose denormalized counters
the reducer updates in the same locked mutation) must wrap the whole scan in
crate::RunLock::with_shared_lock (LOCK_SH). That excludes the reducer’s
exclusive lock for the scan’s duration, so the reader observes one committed
snapshot rather than a half-applied update (design.md §4). The lock is
released before the result is serialized.
Functions§
- read_
discussion - Read and schema-validate one discussion. Errors if it is missing.
- read_
discussion_ opt - Read and schema-validate one discussion, returning
Noneif absent. - read_
manifest - Read and schema-validate the run manifest. Errors if it is missing.
- read_
manifest_ opt - Read and schema-validate the run manifest, returning
Noneif absent. - read_
node - Read and schema-validate one node. Errors if it is missing.
- read_
node_ opt - Read and schema-validate one node, returning
Noneif absent. - read_
spinoff - Read and schema-validate one spin-off proposal. Errors if it is missing.
- read_
spinoff_ opt - Read and schema-validate one spin-off proposal, returning
Noneif absent. - write_
node - Atomically write a node’s projection file, keyed by its
node_id.