Skip to main content

Prompter

Trait Prompter 

Source
pub trait Prompter: Send + Sync {
    // Required methods
    fn confirm(&self, message: &str, default: bool) -> Result<bool>;
    fn input(&self, prompt: &str) -> Result<String>;
    fn input_with_default(&self, prompt: &str, default: &str) -> Result<String>;
    fn select(&self, prompt: &str, items: &[String]) -> Result<usize>;
    fn password(&self, prompt: &str) -> Result<String>;
}

Required Methods§

Source

fn confirm(&self, message: &str, default: bool) -> Result<bool>

Source

fn input(&self, prompt: &str) -> Result<String>

Source

fn input_with_default(&self, prompt: &str, default: &str) -> Result<String>

Source

fn select(&self, prompt: &str, items: &[String]) -> Result<usize>

Source

fn password(&self, prompt: &str) -> Result<String>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§