pub struct Input { /* private fields */ }Expand description
A text input field.
Implementations§
Source§impl Input
impl Input
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Sets the description.
Sourcepub fn placeholder(self, placeholder: impl Into<String>) -> Self
pub fn placeholder(self, placeholder: impl Into<String>) -> Self
Sets the placeholder text.
Sourcepub fn char_limit(self, limit: usize) -> Self
pub fn char_limit(self, limit: usize) -> Self
Sets the character limit.
Sourcepub fn inline(self, inline: bool) -> Self
pub fn inline(self, inline: bool) -> Self
Sets whether the title and input are on the same line.
Sourcepub fn validate(self, validate: fn(&str) -> Option<String>) -> Self
pub fn validate(self, validate: fn(&str) -> Option<String>) -> Self
Sets the validation function.
Sourcepub fn suggestions(self, suggestions: Vec<String>) -> Self
pub fn suggestions(self, suggestions: Vec<String>) -> Self
Sets the suggestions for autocomplete.
Sourcepub fn get_string_value(&self) -> &str
pub fn get_string_value(&self) -> &str
Gets the current value.
Trait Implementations§
Source§impl Field for Input
impl Field for Input
Source§fn with_theme(&mut self, theme: &Theme)
fn with_theme(&mut self, theme: &Theme)
Sets the theme.
Source§fn with_keymap(&mut self, keymap: &KeyMap)
fn with_keymap(&mut self, keymap: &KeyMap)
Sets the keymap.
Source§fn with_width(&mut self, width: usize)
fn with_width(&mut self, width: usize)
Sets the width.
Source§fn with_height(&mut self, height: usize)
fn with_height(&mut self, height: usize)
Sets the height.
Source§fn with_position(&mut self, position: FieldPosition)
fn with_position(&mut self, position: FieldPosition)
Sets the field position.
Auto Trait Implementations§
impl Freeze for Input
impl !RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl !UnwindSafe for Input
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