Skip to main content

Prompt

Trait Prompt 

Source
pub trait Prompt: Send {
    // Required method
    fn ask(&mut self, prompt: &str) -> Result<Option<String>>;
}
Expand description

Input reader trait so tests can feed confirmation text without touching real stdin.

Required Methods§

Source

fn ask(&mut self, prompt: &str) -> Result<Option<String>>

Emit a prompt line and read the user’s answer. Returns Ok(None) when stdin is closed (EOF).

Implementors§