pub struct KeyInput {
pub buf: String,
pub cursor: usize,
pub revealed: bool,
pub dirty: bool,
}Expand description
Per-field text-input state — cursor + buffer + reveal flag.
Fields§
§buf: String§cursor: usizeChar-index cursor position (0..=buf.chars().count()).
revealed: boolWhen true, the field renders the actual characters; otherwise •.
dirty: boolTrue after the user has typed/edited; only then does save write the value back (avoids clobbering an existing key with the empty placeholder the user opened the dialog with).
Implementations§
Source§impl KeyInput
impl KeyInput
pub fn from_config(initial: Option<&str>) -> Self
pub fn insert_char(&mut self, c: char)
pub fn backspace(&mut self)
pub fn delete(&mut self)
pub fn move_left(&mut self)
pub fn move_right(&mut self)
pub fn move_home(&mut self)
pub fn move_end(&mut self)
pub fn toggle_reveal(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyInput
impl RefUnwindSafe for KeyInput
impl Send for KeyInput
impl Sync for KeyInput
impl Unpin for KeyInput
impl UnsafeUnpin for KeyInput
impl UnwindSafe for KeyInput
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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