pub struct InputField;Expand description
A text input field component.
This component provides a single-line text input with cursor navigation and editing capabilities.
§Navigation
Left/Right- Move cursor by one characterHome/End- Jump to beginning/endWordLeft/WordRight- Move by word
§Editing
Insert(char)- Insert a characterBackspace- Delete before cursorDelete- Delete at cursorDeleteWordBack/DeleteWordForward- Delete by wordClear- Clear all textSetValue(String)- Replace all text
Trait Implementations§
Source§impl Component for InputField
impl Component for InputField
Source§type State = InputFieldState
type State = InputFieldState
The component’s internal state type. Read more
Source§type Message = InputFieldMessage
type Message = InputFieldMessage
Messages this component can receive. Read more
Source§type Output = InputFieldOutput
type Output = InputFieldOutput
Messages this component can emit to its parent. Read more
Source§fn update(state: &mut Self::State, msg: Self::Message) -> Option<Self::Output>
fn update(state: &mut Self::State, msg: Self::Message) -> Option<Self::Output>
Update component state based on a message. Read more
Source§fn handle_event(state: &Self::State, event: &Event) -> Option<Self::Message>
fn handle_event(state: &Self::State, event: &Event) -> Option<Self::Message>
Maps an input event to a component message. Read more
Source§fn view(state: &Self::State, frame: &mut Frame<'_>, area: Rect, theme: &Theme)
fn view(state: &Self::State, frame: &mut Frame<'_>, area: Rect, theme: &Theme)
Render the component to the given area. Read more
Source§impl Focusable for InputField
impl Focusable for InputField
Source§fn is_focused(state: &Self::State) -> bool
fn is_focused(state: &Self::State) -> bool
Returns true if this component is currently focused.
Source§fn set_focused(state: &mut Self::State, focused: bool)
fn set_focused(state: &mut Self::State, focused: bool)
Sets the focus state of this component.
Auto Trait Implementations§
impl Freeze for InputField
impl RefUnwindSafe for InputField
impl Send for InputField
impl Sync for InputField
impl Unpin for InputField
impl UnsafeUnpin for InputField
impl UnwindSafe for InputField
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more