Now I would like to add an add_int method that is generic over any integer type. I.e. it should accept obj.add_int("foo", 3 as i16) as well as obj.add_int("bar", 5 as usize), convert the input to a string and add them to the HashMap. I saw some other - years old - posts that hint that there was an RFC which would allow this. Is there a way to accomplish this using a single generic method?
I guess not. There's already an add_param() that uses ToString. The more specific functions are there for API look'n'feel parity with an existing C++ library. We want C++ developers who want to try to use Rust for client applications to feel right at home with the interfaces.