pub trait StdinReader: Send + Sync {
// Required methods
fn is_terminal(&self) -> bool;
fn read_to_string(&self) -> Result<String>;
}Expand description
Abstraction over stdin reading.
This trait allows tests to mock stdin without actually piping data.
Required Methods§
Sourcefn is_terminal(&self) -> bool
fn is_terminal(&self) -> bool
Check if stdin is a terminal (TTY).
Returns true if stdin is interactive, false if piped.
Sourcefn read_to_string(&self) -> Result<String>
fn read_to_string(&self) -> Result<String>
Read all content from stdin.
This should only be called if is_terminal() returns false.