torrust_tracker/console/clients/checker/
console.rs

1use super::printer::{Printer, CLEAR_SCREEN};
2
3pub struct Console {}
4
5impl Default for Console {
6    fn default() -> Self {
7        Self::new()
8    }
9}
10
11impl Console {
12    #[must_use]
13    pub fn new() -> Self {
14        Self {}
15    }
16}
17
18impl Printer for Console {
19    fn clear(&self) {
20        self.print(CLEAR_SCREEN);
21    }
22
23    fn print(&self, output: &str) {
24        print!("{}", &output);
25    }
26
27    fn eprint(&self, output: &str) {
28        eprint!("{}", &output);
29    }
30
31    fn println(&self, output: &str) {
32        println!("{}", &output);
33    }
34
35    fn eprintln(&self, output: &str) {
36        eprintln!("{}", &output);
37    }
38}