Output

Trait Output 

pub trait Output {
    // Required methods
    fn println(&mut self, text: &str);
    fn print(&mut self, text: &str);
    fn eprintln(&mut self, text: &str);
    fn flush(&mut self);
}
Expand description

Trait for writing output to enable dependency injection and testing

Required Methods§

fn println(&mut self, text: &str)

Write a line to the output

fn print(&mut self, text: &str)

Write text without a newline to the output

fn eprintln(&mut self, text: &str)

Write a line to stderr

fn flush(&mut self)

Flush the output

Implementors§