1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
use std::fmt::Display; use syrette::injectable; use crate::interfaces::printer::IPrinter; pub struct Printer {} #[injectable] impl Printer { pub fn new() -> Self { Self {} } } impl<Printable: Display> IPrinter<Printable> for Printer { fn print(&self, out: Printable) { println!("{}", out); } }