Skip to main content

Prompter

Trait Prompter 

Source
pub trait Prompter {
    // Required methods
    fn ask_string(
        &mut self,
        prompt: &str,
        default: Option<&str>,
        optional: bool,
    ) -> Result<String>;
    fn ask_bool(&mut self, prompt: &str, default: bool) -> Result<bool>;
    fn ask_int(&mut self, prompt: &str, default: Option<i64>) -> Result<i64>;
}
Expand description

Abstraction over interactive prompts so tests can inject scripted answers.

Required Methods§

Source

fn ask_string( &mut self, prompt: &str, default: Option<&str>, optional: bool, ) -> Result<String>

Ask for a free-form string.

Source

fn ask_bool(&mut self, prompt: &str, default: bool) -> Result<bool>

Ask for a boolean (y/n).

Source

fn ask_int(&mut self, prompt: &str, default: Option<i64>) -> Result<i64>

Ask for an integer.

Implementors§