Struct requestty_ui::Input
source · [−]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
sourceimpl<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> RefUnwindSafe for Input<P, B> where
B: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, B> Send for Input<P, B> where
B: Send,
P: Send,
impl<P, B> Sync for Input<P, B> where
B: Sync,
P: Sync,
impl<P, B> Unpin for Input<P, B> where
B: Unpin,
P: Unpin,
impl<P, B> UnwindSafe for Input<P, B> where
B: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more