pub struct Input {
pub cursor_index: usize,
/* private fields */
}Expand description
Holds the chars typed by the user and the cursor position. Methods allow mutation of this content and movement of the cursor.
Fields§
§cursor_index: usizeThe index of the cursor in that string
Implementations§
source§impl Input
impl Input
sourcepub fn cursor_start(&mut self)
pub fn cursor_start(&mut self)
Move the cursor to the start
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
sourcepub fn cursor_end(&mut self)
pub fn cursor_end(&mut self)
Move the cursor to the end
sourcepub fn cursor_left(&mut self)
pub fn cursor_left(&mut self)
Move the cursor left if possible
sourcepub fn cursor_right(&mut self)
pub fn cursor_right(&mut self)
Move the cursor right if possible
sourcepub fn delete_char_left(&mut self)
pub fn delete_char_left(&mut self)
Backspace, delete the char under the cursor and move left
sourcepub fn delete_chars_right(&mut self)
pub fn delete_chars_right(&mut self)
Delete all chars right to the cursor