pub struct TextInputState {
pub value: String,
pub cursor: usize,
pub placeholder: String,
}Expand description
State for a single-line text input widget.
Pass a mutable reference to Context::text_input each frame. The widget
handles all keyboard events when focused.
§Example
let mut input = TextInputState::with_placeholder("Type here...");
ui.text_input(&mut input);
println!("{}", input.value);Fields§
§value: StringThe current input text.
cursor: usizeCursor position as a character index into value.
placeholder: StringPlaceholder text shown when value is empty.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextInputState
impl RefUnwindSafe for TextInputState
impl Send for TextInputState
impl Sync for TextInputState
impl Unpin for TextInputState
impl UnsafeUnpin 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