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§
- Record
Checkout - A record named together with its type — what a widget declares it is working on, and what a workspace index holds.
- Record
Id - The stable identity of a record. Encoded by prefix:
file-record:<uuid>(a file, by the durable id its filesystem record carries — seeRecordId::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, seeRecordId::for_tab) andderived:<role>@<id>(seeRecordId::derived). - Record
Kind - 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). - Record
Ref - One record’s reference to another: annotations → the document they mark up, a duplicate → the record it was copied from.
Enums§
- Record
Save Status - 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
valueis a label that can travel in a workspace index or record stamp: at mostmaxbytes of ASCII letters, digits,.,_and-, beginning with a letter.