pub struct Input {
pub states: InputStates,
/* private fields */
}Expand description
Input represents a read-write input field. This component supports different input types, input length
and handles input events related to cursor position, backspace, canc, …
Fields§
§states: InputStatesImplementations§
Source§impl Input
impl Input
Sourcepub fn foreground(self, fg: Color) -> Self
pub fn foreground(self, fg: Color) -> Self
Set the main foreground color. This may get overwritten by individual text styles.
Sourcepub fn background(self, bg: Color) -> Self
pub fn background(self, bg: Color) -> Self
Set the main background color. This may get overwritten by individual text styles.
Sourcepub fn modifiers(self, m: TextModifiers) -> Self
pub fn modifiers(self, m: TextModifiers) -> Self
Set the main text modifiers. This may get overwritten by individual text styles.
Sourcepub fn style(self, style: Style) -> Self
pub fn style(self, style: Style) -> Self
Set the main style. This may get overwritten by individual text styles.
This option will overwrite any previous foreground, background and modifiers!
Sourcepub fn inactive(self, s: Style) -> Self
pub fn inactive(self, s: Style) -> Self
Set a custom style for the border when the component is unfocused.
Sourcepub fn input_type(self, itype: InputType) -> Self
pub fn input_type(self, itype: InputType) -> Self
Set the type of input this Input Component is for. Specific types may have different display or validate methods.
Sourcepub fn invalid_style(self, s: Style) -> Self
pub fn invalid_style(self, s: Style) -> Self
Set a style for when the input fails validation.
Sourcepub fn placeholder<S: Into<LineStatic>>(self, placeholder: S) -> Self
pub fn placeholder<S: Into<LineStatic>>(self, placeholder: S) -> Self
Set a placeholder text for when the Input is empty.
Trait Implementations§
Source§impl Component for Input
impl Component for Input
Source§fn view(&mut self, render: &mut Frame<'_>, area: Rect)
fn view(&mut self, render: &mut Frame<'_>, area: Rect)
Source§fn query<'a>(&'a self, attr: Attribute) -> Option<QueryResult<'a>>
fn query<'a>(&'a self, attr: Attribute) -> Option<QueryResult<'a>>
Auto Trait Implementations§
impl Freeze for Input
impl !RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnsafeUnpin 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
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>
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>
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