You can use std::intrinsics::type_name() but it is not stable so you must use a nightly build and add #![feature(core_intrinsics)] to your crate root.
It takes a type parameter <T> instead of reading the type of the argument. I think this is because Rust doesn't have type information at runtime. (unlike C# and the CLR)
Looking at the documentation, they say this is 'unlikely to ever be stabilized'.
And yes, I feel that this isn't quite the Rusty way of doing things. May I ask what you are trying to achieve overall? because there is probably an alternative way of doing things.
Hopefully that helps.
ps: if you're looking to do dynamic typing then perhaps std::any will help?
That is the strangest function signature I've ever seen. You specialize it to something so that you avoid an input parameter? Maybe there's a good reason for it but that looks bizarre.
The reason is that Rust doesn't have type information at runtime except with trait objects. And you may not always have an instance to pass in. size_of::<T>() also works the same way.