Expand description
Unified Schema primitive — fields and layout blocks that compose via view!.
Schema holds layout blocks, embedded values, and Field slots and resolves every field once
into one list for rendering and validation.
lens_field reaches into toasty_core (upstream issue #114); retire the walk when Toasty
exposes it (upstream #183).
Re-exports§
pub use lenses::declare;
Structs§
- Choice
Field - A choice field:
Field::choice. - Control
Input - What a
Controlrenders for one form: the field’s key, its current value, and its validation state. - Custom
Field - A field an app’s
Controlrenders:Field::customandField::toggle. - Field
- One form field binding a lens to the control editing it, offering only that control’s modifiers so a modifier on the wrong control does not compile.
- File
Field - A file field:
Field::file. - Grid
- Holds a column container with
colsclamped to 1..12. - Group
- Holds an unlabelled container for grouping fields.
- Repeater
- Holds a nested
Schemarendered once as a titled group and reports arequiredempty group under its label. - Schema
- Composes fields and layout blocks and resolves every field once into one list.
- Section
- Holds a titled container with an optional child
Schema. - Source
- Holds where a schema render reads field values and errors from for a form or a read-only view.
- Text
Field - A text field:
Field::text. - Toggle
- Renders a
boolfield as a checkbox preceded by a hiddenfalse, displaying as"Yes"/"No".
Constants§
- MAX_
RELATIONSHIP_ OPTIONS - Caps the options a relationship choice field loads instead of scanning a large table per select.
Traits§
- Control
- Renders a field’s input from a
ControlInputand its stored value for display, using a hidden field for a state that submits nothing. - Embedded
Form - Reads an embedded value from and writes it to the flat form map; derive it to generate the value’s schema.
- Into
Options - A choice’s static options as
(value, label)pairs, in display order. - Into
Schema - Converts a field, a layout block, a tuple of either, or a schema into a
Schema. - Option
Source - Describes the source a relationship option loader reads.
- Options
- A closed set of stored values, each with its label.
- Typed
Value - Parses a typed column’s text submission and names the type in the error it produces.
Functions§
- declare
- Run
declarationswithdb’s app schema in scope, so every path they bind resolves an embedded leaf to its flattened storage column.