Skip to main content

Module person

Module person 

Expand description

Records an app holds beside the one it shows.

Some of an app’s state is data rather than a preference — what was watched, the words taught to the keyboard, where reading stopped — and is one record of its kind: it grows, it has history, edits to it are undone. It is kept with the app’s other records in the workspace it is open in (PersonRecords::in_workspace) and syncs with the workspace, each member’s own there (RecordId::of_member): one per member, read and changed by that person’s devices alone.

The person’s shared records — their accounts, their contacts — and the settings sections belong to the person, not to any workspace: they are kept in the person’s own scope (PERSONAL_SCOPE), not in an id derived from their key. PersonRecords is where they are kept on this device for one app; StoredRecord is one of them, opened, edited with attribution and undo, and sent on to the person’s other devices (StoredRecord::history_owner).

Such a record carries one route per app and record (StoredRecord::route) naming the person’s own cluster — the one every device of theirs derives from their identity root alone, and the one their store carries between them — so the same record opened by the same app on another device is the same document. On a device whose identity derives no cluster they have no route and stay on that device alone.

Structs§

PersonRecords
Where one app keeps the person’s records on this device. Cloning shares the open records.
StoredRecord
A record held beside the one an app shows: the app’s own of a kind, one of the person’s, or one of the workspace’s (super::workspace), each held the same way. Edits are attributed to the person, recorded as undo steps of their own and synced on the record’s route where it has one.

Constants§

PERSONAL_SCOPE
The scope of the person’s own records, (app, personal): theirs and not a workspace’s, so it is carried to their devices by their personal store and never by a workspace’s route.

Functions§

record_id
The id of the person’s record of kind for an app: one per kind, the same on every device, so every device opens the same record. It plays the kind’s role for the app’s base record rather than for a window’s or a workspace’s, so it is the same wherever the app opens its records.