pub struct TextInput {
pub text: String,
pub cursor: usize,
}Expand description
Reusable text input with cursor, shared by SearchableList and SetupState.
Fields§
§text: String§cursor: usizeImplementations§
Source§impl TextInput
impl TextInput
pub fn new() -> Self
pub fn clear(&mut self)
Sourcepub fn cursor_left(&mut self)
pub fn cursor_left(&mut self)
Move cursor left by one grapheme cluster (UTF-8 safe)
Sourcepub fn cursor_right(&mut self)
pub fn cursor_right(&mut self)
Move cursor right by one grapheme cluster (UTF-8 safe)
pub fn cursor_start(&mut self)
pub fn cursor_end(&mut self)
pub fn cursor_word_left(&mut self)
pub fn cursor_word_right(&mut self)
Sourcepub fn insert_char(&mut self, c: char)
pub fn insert_char(&mut self, c: char)
Insert a character at the current cursor position
Sourcepub fn delete_forward_char(&mut self) -> bool
pub fn delete_forward_char(&mut self) -> bool
Remove the grapheme cluster at cursor position (UTF-8 safe)
Sourcepub fn delete_word(&mut self)
pub fn delete_word(&mut self)
Delete word backwards from cursor position
Sourcepub fn delete_word_forward(&mut self)
pub fn delete_word_forward(&mut self)
Delete word forwards from cursor position
pub fn delete_to_start(&mut self)
pub fn delete_to_end(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextInput
impl RefUnwindSafe for TextInput
impl Send for TextInput
impl Sync for TextInput
impl Unpin for TextInput
impl UnsafeUnpin for TextInput
impl UnwindSafe for TextInput
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