ui only.Expand description
Interactive text editing state.
TextInput models one-line UTF-8 editing over caller-chosen storage.
It keeps the initialized length, cursor position, and TextInputConfig,
while its storage type determines ownership and capacity.
EventKey ── TextInputKeymap ──> TextInputAction
│
▼ apply
TextInput<B> ─────────────────> TextInputOutcome
│ └── Rejected(TextInputReject)
└── borrow ──────────────> TextInputViewTextInputAction expresses storage-independent editing requests.
Applying one produces a TextInputOutcome that distinguishes unchanged
state, mutation, acceptance, cancellation, and rejection.
TextInputView exposes the initialized text and cursor without exposing
its storage representation. The cursor is a byte position on a UTF-8
boundary; character movement and deletion operate on Unicode scalar
boundaries.
When event support is enabled, TextInputKeymap translates normalized
keyboard events into editing actions. Key mapping remains separate from the
editing state itself.
§Boundaries
This module owns editable text state and its explicit transitions.
- General encoding, segmentation, and text processing belong to
text. - Normalized keyboard events come from
ui::event. - Keyboard focus and interaction ownership belong to
ui::route. - Control composition and presentation belong to
ui::widgetandui::view.
It does not define focus acquisition, selection, composition, multiline layout, or rendering.
Structs§
- Text
Input - ▦ 𝐓 One-line editable text state over caller-chosen storage.
- Text
Input Config - ▦ 𝐓
Configuration for
TextInput. - Text
Input Keymap event - ▦ 𝐓 🎫 Maps platform-agnostic keyboard events to text input actions.
- Text
Input View - ▦ 𝐓 Borrowed view of a text input.
Enums§
- Text
Input Action - ▦ 𝐓 🎮
Editing command consumed by
TextInput. - Text
Input Keymap Preset event - ▦ 𝐓 🎫
Preset key mapping for
TextInputAction. - Text
Input Outcome - ▦ 𝐓 ⚖️
Result of applying a
TextInputAction. - Text
Input Reject - ▦ 𝐓 Reason why an action was rejected.