Skip to main content

Module table

Module table 

Source

Structs§

BrokenLink
One markdown link of a record that resolves to nothing — the field the link was found in against the virtual path it aimed at, kept apart rather than formatted into a sentence, so a caller can group by field or retry the target without parsing text back out.
FollowPolicy
How often a handle catches up with foreign writes on its own, before serving a read — the port of the TS FollowPolicy (packages/hayson/src/table/table.ts).
HistoryEntry
One log line naming a record, as Table::history read it off the file — the version itself, not the record as the live schema would project it.
PreparedTxnEntry
A validated, _seq-assigned, serialized log line produced by Table::prepare_txn_ops — nothing on disk yet, but everything needed to journal it and, later, to append it.
PutOutcome
The result of Table::put_with_warnings/Table::patch_with_warnings — the written record plus diagnostics that do not block the write (currently only broken markdown links found while Table::link_parsing is Eager; empty for a Lazy table, which surfaces them only on request via Table::broken_links_of). Table::put/Table::patch stay untouched and keep returning a bare HaysonRecord on a separate method, rather than changing their own signature, so no existing caller has to start handling warnings it never asked for.
RotationResult
What one run of Table::rotate_cypher_keys did. Counts records, not fields: a record with two cypher fields on a retired key is rotated once and counted once.
Table
Ties TableRegistry (indexes), WriteQueue (validation, uniqueness, staging) and LogFile (persistence) into one table API. Deliberately thin: put/patch/delete all delegate their validation and unique-checking to WriteQueue::stage_put, they do not repeat it here.
TableHistory
Every version of one key, with the files that were read to find them — the answer of Table::history.
TableStats
The counters behind Table::stats, in the shape of the TS TableStats.

Enums§

CachePolicy
How many parsed documents a table keeps in memory in front of its log — the read cache crate::table::Table::get answers a repeated read from instead of re-reading and re-parsing the line the registry points at.
CommitError
WriteQueue::commit_sealed’s failure: an I/O error appending to the log, or the seal closure refusing a cypher field (no key to write it with).
LogOp
RefreshOutcome
What Table::refresh found on disk since this handle last looked. Modelled on RestoreOutcome, which reports the same kind of thing about an open: not whether it worked, but which of its two ways it had to work.
StageError
TableError
TxnOp
One operation staged in a multi-table unit of work, ready for Table::prepare_txn_ops.

Constants§

LOG_SUFFIX

Functions§

partition_names_in
The partition names dir already holds a log file for, sorted. A directory that does not exist yet is simply a table nothing was written to.