1 2 3 4 5 6 7 8 9 10 11
use super::tracer_trait::TracerTrait; pub trait AsTracer { fn as_tracer<'a>(&'a mut self) -> Box<dyn 'a + TracerTrait>; } impl AsTracer for () { fn as_tracer<'a>(&'a mut self) -> Box<dyn 'a + TracerTrait> { Box::new(self) } }