pub struct Prompt { /* private fields */ }
Expand description
The Prompt represents the current query, the cursor position in that query and when it was updated.
When the query in the prompt changes the timestamp is updated to reflect that is a fresh query. This is then used to print to the UI only latest changes.
Implementations§
source§impl Prompt
impl Prompt
pub fn add(&mut self, ch: char)
pub fn backspace(&mut self) -> bool
pub fn clear(&mut self)
pub fn left(&mut self)
pub fn right(&mut self)
pub fn cursor_at_end(&mut self)
pub fn cursor_at_start(&mut self)
pub fn cursor_until_end(&self) -> usize
pub fn as_string(&self) -> String
pub fn timestamp(&self) -> Instant
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn refresh(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Prompt
impl Send for Prompt
impl Sync for Prompt
impl Unpin for Prompt
impl UnwindSafe for Prompt
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