Map data structure in Thrust

This is somewhat related to my previous question. After some searching, I came to the conclusion that I need a hash map with integer numbers as keys and memory-intensive structures as values. But I can’t find any good example on how to implement it?
I need to get value by key or create empty if it doesn’t exist, insert key-value pair and get the total count of pairs. I saw cuda-thrust-extensions, but that’s not really what I need.
Maybe I should write a custom kernel for this and not use Thrust?
Thank you, and sorry if my question seems stupid.