Expand description
The stored layout of a model, as data.
Model::SHAPE describes how a value lives in the
document without reading it: which keys a record has, which of them are
keyed collections, what is written whole. Generic services use it to act on
any record correctly — History restores a past version field by field and
item by item, the way an action would have written it, instead of replacing
the document wholesale.
#[derive(Model)] produces the shape of a struct from its fields; plain
types are Shape::Value. A type with its own layout may declare a shape
by hand, or keep the default and opt out of layout-aware services.
Structs§
- Field
Shape - One named field of a
Shape::Record.
Enums§
- Shape
- How one value is laid out in the document.
- Trust
- Who may change a field without being asked, by what a change of it can do to the person: every API decides it from the published field edit.
Constants§
- ENTRY_
ORDER_ KEY - The key of a collection entry’s order key.
- ENTRY_
VALUE_ KEY - The key of a collection entry’s value.
Functions§
- absent_
scalar - The value an absent key of a scalar
Treads as, in JSON;Nonefor a type stored as an object or without an empty value. - stored_
text - The first non-empty line of the text a
Tstored asvalueatidcarries, asModel::labelreads it from the value.
Type Aliases§
- Stored
Text - Reads the first line of a field’s text from where it is stored.