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).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§