Expand description
Typed paths into a model and the field edits made at them.
#[derive(Model)] gives every type a path struct: Snippets::paths()
has one field per model field, a Collection path
offers item, a Grid path
cell, a map path key. A Path is plain
data — the stored field names and item ids from the record’s root — so it
can be stored, compared and sent.
Each path offers the edits its type supports. An edit is an Edit: a
path and an EditOp. It is one of the resource’s actions, so it
replays, syncs, undoes and is named in history like a verb, and it
applies at its path without reading the rest of the record.
Structs§
- Edit
- A field edit of the record
R: a path and an operation. See the module docs. - OpDescription
- What an edit in a type’s own vocabulary did (
Operations::describe). - Path
- The location of a
Tinside the recordR. See the module docs.
Enums§
- At
- Where an inserted or moved item goes: a position (clamped to the end), the end, or beside an item named by its id.
- EditOp
- What an
Editdoes at its path. Text positions count characters. - Segment
- One step of a
Path.
Constants§
- OP_
ARGUMENTS - What each field-edit operation takes beside
pathandop, as its JSON form reads it: the operation’s name, the arguments it requires and the ones it may be given. The published field-edit schema states these, so an agent reading it sends what the edit needs;op_arguments_match_what_an_edit_readsholds the table to the reader.
Traits§
- Operations
- A type with its own vocabulary of edits beside the generic ones: rich
text’s marks and blocks. Its paths offer
Path::perform; itsModelimpl callsoperations_model!so records holding it route those edits’ gestures, landing places and schema to it. - Settable
- Values a path can
setwhole: scalars, enums, text, short lists, options of them and nested records. Containers whose merge is per element (Counter,Set,Collection,Grid,Outbox) are edited per element instead.
Functions§
- op_
argument_ schema - The schema of the argument
argumentof the operationop, as its JSON form reads it. An argument several operations share (at,id) has one schema that holds for each of them. - op_
arguments - The arguments the operation
oprequires and may be given (OP_ARGUMENTS);Nonefor no operation of that name. - op_
usage - How the operation
opreads in a listing of what a path takes, with its arguments:remove-item {id},move-to {id, at?}; an operation that takes only a value (set) by its name. - outbox_
settle_ arguments - The arguments of
FIELD_EDITthat settle entryidof the outbox stored at fieldfieldwithoutcome(aSettledin JSON form):Path::settlefor a host that holds the record without its app’s types, such as a workspace’s host settling what a bot’s connector performed. - retyped_
all edits, of the recordR.