1 2 3 4 5 6 7 8 9
pub trait Debugger { fn send(&mut self, _msg: &str); } impl<F> Debugger for F where F: FnMut(&str) { fn send(&mut self, msg: &str) { (self)(msg) } }