pub struct EditingState {
pub text: String,
pub selection_base: i32,
pub selection_extent: i32,
pub composing_base: i32,
pub composing_extent: i32,
}Expand description
The full editing state of a text field, the one struct every IME bridge syncs.
This mirrors Flutter’s canonical editing-state shape (−1 = “none” for the
selection/composing anchors). It is the value pushed across the framework↔
platform seam in both directions.
§Index boundary rule
An EditingState crossing the AppTree/shell seam is UTF-16 code-unit
indexed (selection_*/composing_* count UTF-16 units, the platform-native
unit for both Android Editable and iOS NSMutableString). Widgets and
frust-text convert to/from Rust byte offsets at their own boundary.
Core carries the value opaquely and makes no index interpretation.
Fields§
§text: StringThe full text content.
selection_base: i32Selection anchor (UTF-16 unit index at the shell seam; −1 = none).
selection_extent: i32Selection focus (UTF-16 unit index at the shell seam; −1 = none).
composing_base: i32Composing-region start (UTF-16 unit index; −1 = not composing).
composing_extent: i32Composing-region end (UTF-16 unit index; −1 = not composing).
Trait Implementations§
Source§impl Clone for EditingState
impl Clone for EditingState
Source§impl Debug for EditingState
impl Debug for EditingState
Source§impl Default for EditingState
impl Default for EditingState
impl Eq for EditingState
Source§impl PartialEq for EditingState
impl PartialEq for EditingState
impl StructuralPartialEq for EditingState
Auto Trait Implementations§
impl Freeze for EditingState
impl RefUnwindSafe for EditingState
impl Send for EditingState
impl Sync for EditingState
impl Unpin for EditingState
impl UnsafeUnpin for EditingState
impl UnwindSafe for EditingState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.