Skip to main content

Module path

Module path 

Source
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 T inside the record R. 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 Edit does at its path. Text positions count characters.
Segment
One step of a Path.

Constants§

OP_ARGUMENTS
What each field-edit operation takes beside path and op, 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_reads holds 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; its Model impl calls operations_model! so records holding it route those edits’ gestures, landing places and schema to it.
Settable
Values a path can set whole: 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 argument of the operation op, 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 op requires and may be given (OP_ARGUMENTS); None for no operation of that name.
op_usage
How the operation op reads 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_EDIT that settle entry id of the outbox stored at field field with outcome (a Settled in JSON form): Path::settle for 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 record R.