pub struct InputField { /* private fields */ }Expand description
Represents a user input field.
Implementations§
Source§impl InputField
impl InputField
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new InputField.
Sourcepub fn create<'c, C: Into<Cow<'c, str>>>(title: C) -> Self
pub fn create<'c, C: Into<Cow<'c, str>>>(title: C) -> Self
Creates a new InputField with the provided title.
Sourcepub fn title(&self) -> &str
pub fn title(&self) -> &str
Gets the InputField title.
Sourcepub fn run(&mut self, terminal: &mut DefaultTerminal) -> Result<String>
pub fn run(&mut self, terminal: &mut DefaultTerminal) -> Result<String>
Runs an event loop for the InputField.
Sourcepub fn as_widget(&self) -> Paragraph<'_>
pub fn as_widget(&self) -> Paragraph<'_>
Converts the InputField into a TUI widget.
Sourcepub fn constraint(&self) -> Constraint
pub fn constraint(&self) -> Constraint
Gets the layout constraint required to render the InputField.
Source§impl InputField
impl InputField
Sourcepub const fn input_mode(&self) -> InputMode
pub const fn input_mode(&self) -> InputMode
Gets the InputField input_mode.
Sourcepub fn set_input_mode(&mut self, val: InputMode)
pub fn set_input_mode(&mut self, val: InputMode)
Sets the InputField input_mode.
Sourcepub fn with_input_mode(self, val: InputMode) -> Self
pub fn with_input_mode(self, val: InputMode) -> Self
Builder function that sets the InputField input_mode.
Trait Implementations§
Source§impl Clone for InputField
impl Clone for InputField
Source§fn clone(&self) -> InputField
fn clone(&self) -> InputField
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InputField
impl Debug for InputField
Source§impl Default for InputField
impl Default for InputField
Source§impl PartialEq for InputField
impl PartialEq for InputField
Source§impl Widget for &InputField
impl Widget for &InputField
impl Eq for InputField
impl StructuralPartialEq for InputField
Auto Trait Implementations§
impl Freeze for InputField
impl RefUnwindSafe for InputField
impl Send for InputField
impl Sync for InputField
impl Unpin 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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