pub struct TerminalPrompt<R, W> { /* private fields */ }Expand description
PromptSource impl that renders to stderr and reads from stdin.
Generic over the streams so tests can drive it through tokio::io::duplex.
Implementations§
Source§impl<R, W> TerminalPrompt<R, W>
impl<R, W> TerminalPrompt<R, W>
Source§impl TerminalPrompt<BufReader<Stdin>, Stderr>
impl TerminalPrompt<BufReader<Stdin>, Stderr>
Sourcepub fn from_real_io() -> Self
pub fn from_real_io() -> Self
Build a TerminalPrompt over the process’s real stdin/stderr.
Trait Implementations§
Source§impl<R, W> PromptSource for TerminalPrompt<R, W>
impl<R, W> PromptSource for TerminalPrompt<R, W>
async fn ask_string(&mut self, field: &Field, default: &str) -> Result<String>
async fn ask_bool(&mut self, field: &Field, default: bool) -> Result<bool>
async fn ask_select( &mut self, field: &Field, default_idx: usize, ) -> Result<usize>
async fn ask_multiselect( &mut self, field: &Field, default_indices: &[usize], ) -> Result<Vec<usize>>
Auto Trait Implementations§
impl<R, W> Freeze for TerminalPrompt<R, W>
impl<R, W> RefUnwindSafe for TerminalPrompt<R, W>where
W: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, W> Send for TerminalPrompt<R, W>
impl<R, W> Sync for TerminalPrompt<R, W>
impl<R, W> Unpin for TerminalPrompt<R, W>
impl<R, W> UnsafeUnpin for TerminalPrompt<R, W>where
W: UnsafeUnpin,
R: UnsafeUnpin,
impl<R, W> UnwindSafe for TerminalPrompt<R, W>where
W: UnwindSafe,
R: 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