pub struct Input<P, B: Backend> { /* private fields */ }Expand description
A ui runner which implements the render cycle.
It renders and processes events with the help of a type that implements Prompt.
See run for more information
Implementations§
Source§impl<P, B: Backend> Input<P, B>
impl<P, B: Backend> Input<P, B>
Sourcepub fn new(prompt: P, backend: &mut B) -> Input<P, &mut B>
pub fn new(prompt: P, backend: &mut B) -> Input<P, &mut B>
Creates a new Input. This won’t do anything until it is run.
Sourcepub fn hide_cursor(self) -> Self
pub fn hide_cursor(self) -> Self
Hides the cursor while running the input. This won’t do anything until it is run.
Sourcepub fn on_esc(self, on_esc: OnEsc) -> Self
pub fn on_esc(self, on_esc: OnEsc) -> Self
What to do after receiving a Esc.
For OnEsc::Terminate - an Error::Aborted will be returned.
For OnEsc::SkipQuestion - the currently shown prompt will be cleared, and Ok(None)
will be returned.
For OnEsc::Ignore - no special behaviour will be applied to the Esc key. Like other
keys, the Esc key will be passed to the prompt to handle.
Trait Implementations§
Auto Trait Implementations§
impl<P, B> Freeze for Input<P, B>
impl<P, B> RefUnwindSafe for Input<P, B>where
P: RefUnwindSafe,
B: RefUnwindSafe,
impl<P, B> Send for Input<P, B>
impl<P, B> Sync for Input<P, B>
impl<P, B> Unpin for Input<P, B>
impl<P, B> UnwindSafe for Input<P, B>where
P: UnwindSafe,
B: UnwindSafe,
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