pub struct TextInputData {
pub text: String,
pub cursor_x: usize,
pub cursor_y: usize,
pub tab_width: usize,
}
Expand description
Handles key presses, writing text, and moving the cursor
Fields§
§text: String
§cursor_x: usize
§cursor_y: usize
§tab_width: usize
Implementations§
Source§impl TextInputData
impl TextInputData
pub fn write_char(&mut self, c: char) -> Result<(), Error>
pub fn insert_char(&mut self, c: char, x: usize, y: usize)
pub fn remove_character(&mut self, x: usize, y: usize) -> Result<(), Error>
pub fn get_amt_lines(&mut self) -> usize
pub fn get_line_at(&mut self, y: usize) -> Option<&str>
pub fn get_current_line_length(&mut self) -> Result<usize, Error>
Auto Trait Implementations§
impl Freeze for TextInputData
impl RefUnwindSafe for TextInputData
impl Send for TextInputData
impl Sync for TextInputData
impl Unpin for TextInputData
impl UnwindSafe for TextInputData
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