1 2 3 4 5 6 7 8 9 10 11
//! Generic `type_name()` accessor(s) for e.g. `log::debug!()` use, etc. use std::any::type_name; pub trait GetTypeName { fn type_name(&self) -> &'static str; } impl <T: ?Sized> GetTypeName for T { fn type_name(&self) -> &'static str { type_name::<T>() } }