pub trait CliIo: Sync {
// Required methods
fn read_text(&self, source: &str) -> Result<String, String>;
fn write_stdout(&mut self, text: &str);
fn write_stderr(&mut self, text: &str);
fn version(&self) -> &str;
}Expand description
Everything the command touches outside its arguments.
Required Methods§
Sourcefn read_text(&self, source: &str) -> Result<String, String>
fn read_text(&self, source: &str) -> Result<String, String>
The text an argument names: a file, standard input for -, or a URL.
§Errors
Why the source cannot be read; the command names the argument.
Sourcefn write_stdout(&mut self, text: &str)
fn write_stdout(&mut self, text: &str)
Writes to standard output.
Sourcefn write_stderr(&mut self, text: &str)
fn write_stderr(&mut self, text: &str)
Writes to standard error.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl CliIo for StandardStreams
Available on crate feature
read only.