Struct tui_prompts::TextState
source · pub struct TextState<'a> { /* private fields */ }
Implementations§
source§impl<'a> TextState<'a>
impl<'a> TextState<'a>
pub const fn new() -> Self
pub const fn with_status(self, status: Status) -> Self
pub const fn with_focus(self, focus: FocusState) -> Self
pub fn with_value(self, value: impl Into<Cow<'a, str>>) -> Self
pub const fn is_finished(&self) -> bool
Trait Implementations§
source§impl<'a> PartialEq for TextState<'a>
impl<'a> PartialEq for TextState<'a>
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 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)
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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