pub trait TextInput {
// Required methods
fn text(&self) -> Fragment<'_>;
fn move_cursor_to_front(&mut self);
fn move_cursor_to_end(&mut self);
fn move_cursor_to(&mut self, location: Position);
fn select_all(&mut self);
fn select_range(&mut self, start: Position, end: Position);
}Expand description
The internal state of a widget that has text input.
Required Methods§
Sourcefn text(&self) -> Fragment<'_>
fn text(&self) -> Fragment<'_>
Returns the current visible text of the text input.
Normally, this is either its value or its placeholder.
Sourcefn move_cursor_to_front(&mut self)
fn move_cursor_to_front(&mut self)
Moves the cursor of the text input to the front of the input text.
Sourcefn move_cursor_to_end(&mut self)
fn move_cursor_to_end(&mut self)
Moves the cursor of the text input to the end of the input text.
Sourcefn move_cursor_to(&mut self, location: Position)
fn move_cursor_to(&mut self, location: Position)
Moves the cursor of the text input to an arbitrary location.
Sourcefn select_all(&mut self)
fn select_all(&mut self)
Selects all the content of the text input.
Sourcefn select_range(&mut self, start: Position, end: Position)
fn select_range(&mut self, start: Position, end: Position)
Selects the given content range of the text input.