Trait InputOutput
Source pub trait InputOutput {
// Required methods
fn print(&self, text: &str) -> Result<(), Error>;
fn println(&self, text: &str) -> Result<(), Error>;
fn flush(&self) -> Result<(), Error>;
fn read_line(&self) -> Result<String, Error>;
fn read_line_with_timeout(&self, timeout: Duration) -> Result<String, Error>;
}
Expand description
Trait abstraction for input/output operations to enable mocking
Print text to output
§Errors
Returns an error if the output operation fails
Print text to output with newline
§Errors
Returns an error if the output operation fails
Flush output buffer
§Errors
Returns an error if the flush operation fails
Read a line of input from user
§Errors
Returns an error if the input operation fails
Read a line of input from user with timeout
§Errors
Returns an error if the input operation fails or times out