Skip to main content

EditableDecl

Struct EditableDecl 

Source
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: Rect

World-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: TextLayoutSnapshot

Paint-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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.