Support Rust types with more than one type parameter, test with HashMap

Thanks to @untitaker for this patch.