pub struct TextInput { /* private fields */ }Expand description
A single-line text input field.
Implementations§
Source§impl TextInput
impl TextInput
Trait Implementations§
Source§impl Field for TextInput
impl Field for TextInput
Source§fn render(&self, area: Rect, buf: &mut Buffer, focused: bool, style: &FormStyle)
fn render(&self, area: Rect, buf: &mut Buffer, focused: bool, style: &FormStyle)
Renders the field to the buffer.
Source§fn handle_input(&mut self, event: &KeyEvent) -> bool
fn handle_input(&mut self, event: &KeyEvent) -> bool
Handles keyboard input. Returns true if the input was consumed.
Source§fn validate(&self) -> Result<(), Vec<ValidationError>>
fn validate(&self) -> Result<(), Vec<ValidationError>>
Validates the field and returns any errors.
Source§fn is_required(&self) -> bool
fn is_required(&self) -> bool
Returns whether this field is required.
Auto Trait Implementations§
impl Freeze for TextInput
impl !RefUnwindSafe for TextInput
impl Send for TextInput
impl Sync for TextInput
impl Unpin for TextInput
impl !UnwindSafe for TextInput
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