pub struct TextState<'a> { /* private fields */ }Implementations§
Source§impl<'a> TextState<'a>
impl<'a> TextState<'a>
pub const fn new() -> TextState<'a>
pub const fn with_status(self, status: Status) -> TextState<'a>
pub const fn with_focus(self, focus: FocusState) -> TextState<'a>
pub fn with_value(self, value: impl Into<Cow<'a, str>>) -> TextState<'a>
pub const fn is_finished(&self) -> bool
Trait Implementations§
Source§impl State for TextState<'_>
impl State for TextState<'_>
Source§fn status_mut(&mut self) -> &mut Status
fn status_mut(&mut self) -> &mut Status
A mutable reference to the status of the prompt.
Source§fn focus_state_mut(&mut self) -> &mut FocusState
fn focus_state_mut(&mut self) -> &mut FocusState
A mutable reference to the focus state of the prompt.
Source§fn focus_state(&self) -> FocusState
fn focus_state(&self) -> FocusState
The focus state of the prompt.
Source§fn position_mut(&mut self) -> &mut usize
fn position_mut(&mut self) -> &mut usize
A mutable reference to the position of the cursor in the prompt.
Source§fn cursor_mut(&mut self) -> &mut (u16, u16)
fn cursor_mut(&mut self) -> &mut (u16, u16)
A mutable reference to the cursor position of the prompt.
Source§fn focus(&mut self)
fn focus(&mut self)
Sets the focus state of the prompt to
FocusState::Focused.Source§fn blur(&mut self)
fn blur(&mut self)
Sets the focus state of the prompt to
FocusState::Unfocused.Source§fn is_focused(&self) -> bool
fn is_focused(&self) -> bool
Whether the prompt is focused.
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn handle_key_event(&mut self, key_event: KeyEvent)
fn complete(&mut self)
fn abort(&mut self)
fn delete(&mut self)
fn backspace(&mut self)
fn move_right(&mut self)
fn move_left(&mut self)
fn move_end(&mut self)
fn move_start(&mut self)
fn kill(&mut self)
fn truncate(&mut self)
fn push(&mut self, c: char)
Source§fn width_to_pos(&self, pos: usize) -> usize
fn width_to_pos(&self, pos: usize) -> usize
The character width of the stored value up to the position pos.
impl<'a> Eq for TextState<'a>
impl<'a> StructuralPartialEq for TextState<'a>
Auto Trait Implementations§
impl<'a> Freeze for TextState<'a>
impl<'a> RefUnwindSafe for TextState<'a>
impl<'a> Send for TextState<'a>
impl<'a> Sync for TextState<'a>
impl<'a> Unpin for TextState<'a>
impl<'a> UnwindSafe for TextState<'a>
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