Struct trompt::Trompt
[−]
[src]
pub struct Trompt<'a, R: 'a + BufRead, W: 'a + Write> { /* fields omitted */ }
Methods
impl<'a, R: 'a + BufRead, W: 'a + Write> Trompt<'a, R, W>
[src]
fn new(input: &'a mut R, output: &'a mut W) -> Trompt<'a, R, W>
Start a new prompter with default values.
fn message(&mut self, message: &str) -> &mut Trompt<'a, R, W>
Set the message before the input.
fn silent(&mut self, silent: bool) -> &mut Trompt<'a, R, W>
Set to true if you want to hide the user input. For example for passwords.
fn send(&mut self) -> Result<String>
Send the request to the user.
fn prompt(&mut self, message: &str) -> Result<String>
A helper. Same as .message(message).send()
.
fn confirm(&mut self, message: &str) -> Result<bool>
A helper for retrieving confirmation from the user. Maps y
and yes
case insensitively to true and n
and no
to
false.