Expand description
The founding an app’s record is derived from: what every holder makes of it alike.
An app’s record holds its content alone. Two devices that make the same record before they
sync (a person’s vault opened on a phone and a laptop at once) would each make the containers
its fields keep their items in, and the items one of them adds first would land in a
container the merge leaves behind. So the containers come first, in one change every holder
derives from the record’s workspace, kind and id alone (Scope): an actor derived from them
makes it at time zero. The store admits that change only as the one it derives itself
(structure); the app’s own first values follow as any change of its.
The workspace is part of every derivation. A record’s id can be the same in every workspace (a workspace’s own accounts record), and a change two workspaces both held would be one change in both: a host keeping both would refuse the second, and the hash would link records the workspaces keep apart.
Modules§
- split
- Bringing together a record whose root containers its devices each made of their own: what a
record founded before every holder derived its founding (
super::structure) needs once, and what a merge of such records leaves to do.
Structs§
- Scope
- The record a founding and its steps are derived for: the record
idofkindin the workspaceworkspace. A record is always one workspace’s, so two workspaces holding a record of the same kind and id still derive changes of their own, and the holders within one derive the same.
Functions§
- bring_
up - Bring the record
scopenames, the appapp‘s, toversion, in the one way every holder does: a record made before its founding was derived (two devices’ own root containers) takes the founding and has what its devices made apart brought together (split::merge_split_containers); then the chain of steps up toversion(chain) is written where it is not yet, and last the app’s ownrewriteof its content from the version the record stood at (crate::evolution::rewrite). Whether this changed anything. - bring_
up_ resource bring_upof the recordidof the resource typeRinworkspace, by the containers and version its surface declares and its own migration (#[resource(migrate = ..)]).- chain
- The derived founding of the record
scopenames (structure) followed by the steps that bring it to each version up toversion(crate::evolution::step): the chain every holder of a record atversionstands on. Each step follows the one before it, the first the founding, so two holders that wrote their own changes meanwhile still make it byte for byte alike. - containers
- The containers at the root of
surface’s record that its top-level fields keep their items in, by field name: a collection, map, set or outbox in a map, a list in a list, a record of its own in a map: whatstructuremakes. - found
- Give the record
scopenames, the appapp‘s, its derived founding when it was made without one (two devices’ own root containers, before every holder derived it), and bring together what its devices made apart (split::merge_split_containers): once, the first part ofbring_up, and all a store that reads no type’s version does on opening a record. Whether this changed anything. - migrate
- The step that brings the record
scopenames toversion, on the chainchainderives: the one change a store admits under the migration verb for that version, and the one every holder writes. - new_
record - A new record
idofRinworkspace: its derived founding and the steps toR’s version (chain), thenR’s first values, left uncommitted for the caller to commit under its own message. Its version comes from the chain alone, as every holder of the record derives it. - of_kind
- The containers a record of
surface’s kind founds with: its own record’s (containers), as the store reads the kind’s type from the surface. A surface naming its record by its label declares no type of its kind, and an enum of its kind is no record: either founds with none. - structure
- The derived founding of the record
scopenames, whose fields keep their items in thecontainersnamed at its root. A kind that keeps none founds with a change that holds nothing: every record has its founding as its first head, so a record nothing was written to yet is kept and read back like any other, and what follows the founding names it as its dependency.