Guide API
Skip to main content

Module data

Module data 

Source
Expand description

Typed dialog-data transfer — the value currency moved between controls and the dialog that owns them, and the open seam for third-party components.

A control exposes its current value as a FieldValue via the value/set_value pair on the View trait. A dialog gathers the whole record by walking its children in order (Group::gather_data → Vec<Option<FieldValue>>, the positional primitive; Group::gather_list → one ordered FieldValue::List) and distributes edited values back the same way (Group::scatter_data / Group::scatter_list).

FieldValue carries the well-known shapes a control transfers (Text, Int, Bool, Bits for cluster controls, List for a whole record) plus Custom — the open escape for payloads a user-written component invents. Color is deliberately NOT a FieldValue (it is a 4-variant enum and rides the by-value exec_view_with path).

Extensibility: see the extensibility guide for the three open paths and the Custom / value_as contract (runtime-checked, fail-loud, typed at the edges).

Guide: Dialogs & data.

§Turbo Vision heritage

The original moved dialog data through an untyped getter/setter protocol over a raw record (getData/setData/dataSize, anonymous void*). tvision-rs replaces that with this typed value currency (deviation D10); the Custom seam keeps the original’s openness to arbitrary payloads without its loss of type safety.

Structs§

FieldTypeError
A FieldValue::value_as type mismatch — names the expected type and the found variant/payload, so a contract mismatch fails loudly.

Enums§

FieldValue
The typed unit of dialog data transfer (the D10 value currency).

Traits§

CustomValue
Marker for a user-invented payload carried in FieldValue::Custom.