pub struct EditableDecl {
pub value: String,
pub rect: Rect,
pub multiline: bool,
pub obscure: bool,
pub on_change: Arc<dyn Fn(String) + Send + Sync>,
pub controller: Option<EditController>,
pub layout: TextLayoutSnapshot,
pub filters: Vec<InputFilter>,
}Expand description
What an editable widget declares onto its render-tree node each paint
(D112) — cleared and re-declared every repaint, like hits/scrolls.
The engine’s key/click dispatch finds this via the render tree, NOT a
captured closure: computing a click->glyph position needs FontCache
(!Sync, cannot cross into a Send + Sync closure), and mutating the
caret needs Rc<RefCell<RenderTree>> (!Send, same problem) — both
are reachable from engine.rs, neither is reachable from a plain
Arc<dyn Fn + Send + Sync> hit callback.
Fields§
§value: String§rect: RectWorld-space rect this paint, for click-to-focus hit testing.
multiline: bool§obscure: bool§on_change: Arc<dyn Fn(String) + Send + Sync>§controller: Option<EditController>Optional programmatic handle (D116) — None for the common case
(an app that only uses .value()/.on_change()).
layout: TextLayoutSnapshotPaint-time glyph geometry (D116 layer 3) — click-to-glyph, drag
selection, and double/triple-click all query this with zero
FontCache access.
filters: Vec<InputFilter>Input filters (D116 Step 8) — see the module section above.