Skip to main content

Module record

Module record 

Expand description

A record’s identity: what it is (RecordKind), which one it is (RecordId), what it references (RecordRef) and the checkout that names all three (RecordCheckout). The id travels on the collaboration wire and names a file on disk; the toolkit’s record store (ui::record) keeps the documents these name.

Modules§

fields
Reading a record document’s own fields, failing closed: a field present in another shape, or written by concurrent changes that disagree, reads as invalid rather than absent. Two devices writing the same value without having seen each other’s change agree, and read as that value. The toolkit’s record store (ui::record) and this crate’s record readers share these.
retirement
Whether a record left its workspace: moving a record to another workspace stamps its last change here retired (the toolkit’s ui::record::transfer), and a retired record is never opened as a live document again.
save
A record’s save state: its on-disk copy in a workspace this device governs, and whether what the record holds has reached it.

Structs§

RecordCheckout
A record named together with its type — what a widget declares it is working on, and what a workspace index holds.
RecordId
The stable identity of a record. Encoded by prefix: file-record:<uuid> (a file, by the durable id its filesystem record carries — see RecordId::identify_file), file:<absolute path> (a file known only by where it is: a not-yet-written Save As target, or a filesystem that can’t hold the durable id), uuid:<uuid> (minted, for a record with no natural name), tab:<tab id> (a window’s scratch document until a file names it, see RecordId::for_tab) and derived:<role>@<id> (see RecordId::derived).
RecordKind
What kind of thing a record is — document, annotation-set, book, playlist. App-owned rather than system-registered, so an app can add a kind without coordinating; the cost is no cross-app library view yet (needs a system-owned type registry, not built here).
RecordRef
One record’s reference to another: annotations → the document they mark up, a duplicate → the record it was copied from.

Enums§

RecordSaveStatus
Whether a record’s changes are stored.

Constants§

MAX_FORMER_IDS
Former identities a checkout may name for migration.
MAX_RECORD_RELATION_BYTES
The longest relation or label a record reference may carry.

Functions§

valid_label
Whether value is a label that can travel in a workspace index or record stamp: at most max bytes of ASCII letters, digits, ., _ and -, beginning with a letter.