[][src]Function attr_of::type_of

pub fn type_of<T>(_: &T) -> &'static str

Returns the name of T.

use attr_of::type_of;
assert_eq!(type_of(&String::new()), "alloc::string::String");
assert_eq!(type_of(&1), "i32");