pub struct TextInputState {
pub text: String,
pub selection: Option<Selection>,
pub cursor_pos: usize,
}
Fields§
§text: String
§selection: Option<Selection>
§cursor_pos: usize
Implementations§
Source§impl TextInputState
impl TextInputState
pub fn new<S: Into<String>>(input: S) -> Self
pub fn with_cursor_pos(self, cursor_pos: usize) -> Self
pub fn with_selection(self, selection: Option<Selection>) -> Self
pub fn handle_on_text_input( &mut self, keyboard_state: &KeyboardState, ) -> CallbackReturn
pub fn handle_on_virtual_key_down( &mut self, keyboard_state: &KeyboardState, ) -> CallbackReturn
pub fn delete_selection( &mut self, selection: Range<usize>, new_text: Option<char>, )
Trait Implementations§
Source§impl Clone for TextInputState
impl Clone for TextInputState
Source§fn clone(&self) -> TextInputState
fn clone(&self) -> TextInputState
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TextInputState
impl Debug for TextInputState
Source§impl Default for TextInputState
impl Default for TextInputState
Source§impl Hash for TextInputState
impl Hash for TextInputState
Source§impl PartialEq for TextInputState
impl PartialEq for TextInputState
impl Eq for TextInputState
impl StructuralPartialEq for TextInputState
Auto Trait Implementations§
impl Freeze for TextInputState
impl RefUnwindSafe for TextInputState
impl Send for TextInputState
impl Sync for TextInputState
impl Unpin for TextInputState
impl UnwindSafe for TextInputState
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)