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 event-pass/IME-surface EditingState — see this module’s own docs
for the split against text::EditingState,
frust_text::editor’s distinct, byte-indexed type. ImeContentType is
the input-purpose hint an editable widget publishes on its ImeState so
a shell can lock a secret field’s keyboard down.
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§fn clone(&self) -> EditingState
fn clone(&self) -> EditingState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EditingState
impl Debug for EditingState
Source§impl Default for EditingState
impl Default for EditingState
Source§fn default() -> EditingState
fn default() -> EditingState
An empty field with no selection and no composing region.
Note this is not the derived default: the anchors are the −1
“none” sentinel, not 0 (which would mean a real caret at offset 0).
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
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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.